@noeldemartin/solid-utils 0.1.1-next.3f3913186d2f0057ac597f5ee187ec5132fbeeda → 0.1.1-next.43e8854d84ad29f71c5320cc51f7018a09430819

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.
@@ -11,14 +11,18 @@ declare global {
11
11
  }
12
12
 
13
13
  }
14
- import { Error as Error_2 } from '@noeldemartin/utils';
15
- import type { ErrorOptions } from '@noeldemartin/utils';
14
+ import { JSError } from '@noeldemartin/utils';
15
+ import type { JSErrorOptions } from '@noeldemartin/utils';
16
16
  import type { Quad } from 'rdf-js';
17
17
 
18
18
  export declare type AnyFetch = (input: any, options?: any) => Promise<Response>;
19
19
 
20
+ export declare function compactJsonLDGraph(jsonld: JsonLDGraph): Promise<JsonLDGraph>;
21
+
20
22
  export declare function createPrivateTypeIndex(user: SolidUserProfile, fetch?: Fetch): Promise<string>;
21
23
 
24
+ export declare function createPublicTypeIndex(user: SolidUserProfile, fetch?: Fetch): Promise<string>;
25
+
22
26
  export declare function createSolidDocument(url: string, body: string, fetch?: Fetch): Promise<SolidDocument>;
23
27
 
24
28
  export declare function defineIRIPrefix(name: string, value: string): void;
@@ -51,7 +55,9 @@ export declare function fetchSolidDocumentACL(documentUrl: string, fetch: Fetch)
51
55
 
52
56
  export declare function fetchSolidDocumentIfFound(url: string, fetch?: Fetch): Promise<SolidDocument | null>;
53
57
 
54
- export declare function findContainerRegistration(typeIndexUrl: string, childrenType: string, fetch?: Fetch): Promise<SolidThing | null>;
58
+ export declare function findContainerRegistrations(typeIndexUrl: string, type: string | string[], fetch?: Fetch): Promise<string[]>;
59
+
60
+ export declare function findInstanceRegistrations(typeIndexUrl: string, type: string | string[], fetch?: Fetch): Promise<string[]>;
55
61
 
56
62
  export declare function installChaiPlugin(): void;
57
63
 
@@ -70,6 +76,7 @@ export declare type JsonLD = Partial<{
70
76
  export declare function jsonldEquals(expected: JsonLD, actual: JsonLD): Promise<EqualityResult>;
71
77
 
72
78
  export declare type JsonLDGraph = {
79
+ '@context'?: Record<string, unknown>;
73
80
  '@graph': JsonLDResource[];
74
81
  };
75
82
 
@@ -77,9 +84,9 @@ export declare type JsonLDResource = Omit<JsonLD, '@id'> & {
77
84
  '@id': string;
78
85
  };
79
86
 
80
- export declare function jsonldToQuads(jsonld: JsonLD): Promise<Quad[]>;
87
+ export declare function jsonldToQuads(jsonld: JsonLD, baseIRI?: string): Promise<Quad[]>;
81
88
 
82
- export declare class MalformedSolidDocumentError extends Error_2 {
89
+ export declare class MalformedSolidDocumentError extends JSError {
83
90
  readonly documentUrl: string | null;
84
91
  readonly documentFormat: SolidDocumentFormat;
85
92
  readonly malformationDetails: string;
@@ -88,22 +95,24 @@ export declare class MalformedSolidDocumentError extends Error_2 {
88
95
 
89
96
  export declare function mintJsonLDIdentifiers(jsonld: JsonLD): JsonLDResource;
90
97
 
91
- export declare class NetworkRequestError extends Error_2 {
98
+ export declare class NetworkRequestError extends JSError {
92
99
  readonly url: string;
93
- constructor(url: string, options?: ErrorOptions);
100
+ constructor(url: string, options?: JSErrorOptions);
94
101
  }
95
102
 
96
103
  export declare function normalizeSparql(sparql: string): string;
97
104
 
98
- export declare class NotFoundError extends Error_2 {
105
+ export declare class NotFoundError extends JSError {
99
106
  readonly url: string;
100
107
  constructor(url: string);
101
108
  }
102
109
 
103
110
  export declare function parseResourceSubject(subject: string): SubjectParts;
104
111
 
112
+ export declare function parseTurtle(turtle: string, options?: Partial<ParsingOptions>): Promise<RDFGraphData>;
113
+
105
114
  export declare interface ParsingOptions {
106
- documentUrl: string;
115
+ baseIRI: string;
107
116
  normalizeBlankNodes: boolean;
108
117
  }
109
118
 
@@ -115,10 +124,16 @@ export declare function quadToTurtle(quad: Quad): string;
115
124
 
116
125
  export declare type RDFContext = Record<string, string>;
117
126
 
127
+ export declare interface RDFGraphData {
128
+ quads: Quad[];
129
+ containsRelativeIRIs: boolean;
130
+ }
131
+
118
132
  export declare class SolidDocument extends SolidStore {
119
133
  readonly url: string;
120
134
  readonly headers: Headers;
121
135
  constructor(url: string, quads: Quad[], headers: Headers);
136
+ isACPResource(): boolean;
122
137
  isPersonalProfile(): boolean;
123
138
  isStorage(): boolean;
124
139
  isUserWritable(): boolean;
@@ -196,13 +211,25 @@ export declare function turtleToQuadsSync(turtle: string, options?: Partial<Pars
196
211
 
197
212
  export declare type TypedFetch = (input: RequestInfo, options?: RequestInit) => Promise<Response>;
198
213
 
199
- export declare class UnauthorizedError extends Error_2 {
214
+ export declare class UnauthorizedError extends JSError {
200
215
  readonly url: string;
201
216
  readonly responseStatus?: number;
202
217
  constructor(url: string, responseStatus?: number);
203
218
  get forbidden(): boolean | undefined;
204
219
  }
205
220
 
221
+ export declare class UnsuccessfulNetworkRequestError extends JSError {
222
+ response: Response;
223
+ constructor(response: Response);
224
+ constructor(message: string, response: Response);
225
+ }
226
+
227
+ export declare class UnsupportedAuthorizationProtocolError extends JSError {
228
+ readonly url: string;
229
+ readonly protocol: string;
230
+ constructor(url: string, protocol: string, options?: JSErrorOptions);
231
+ }
232
+
206
233
  export declare function updateSolidDocument(url: string, body: string, fetch?: Fetch): Promise<void>;
207
234
 
208
235
  export { }
@@ -1,2 +1,2 @@
1
- import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.to-string-tag.js";import"core-js/modules/es.reflect.construct.js";import e from"@babel/runtime/helpers/esm/classCallCheck";import t from"@babel/runtime/helpers/esm/assertThisInitialized";import r from"@babel/runtime/helpers/esm/inherits";import n from"@babel/runtime/helpers/esm/possibleConstructorReturn";import o from"@babel/runtime/helpers/esm/getPrototypeOf";import s from"@babel/runtime/helpers/esm/defineProperty";import"core-js/modules/es.array.concat.js";import{Error as u,parseDate as a,stringMatch as i,arrayFilter as c,stringMatchAll as l,objectWithoutEmpty as f,arr as p,tap as d,arrayReplace as m,urlRoot as v,silenced as h,urlParentDirectory as y,urlRoute as j,objectDeepClone as b,urlParse as w,uuid as x,isObject as g,isArray as k,pull as E,arrayRemove as R,urlResolve as T,requireUrlParentDirectory as I}from"@noeldemartin/utils";import P from"@babel/runtime/helpers/esm/createClass";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/esnext.async-iterator.filter.js";import"core-js/modules/esnext.iterator.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import A from"@babel/runtime/helpers/esm/slicedToArray";import O from"@babel/runtime/helpers/esm/asyncToGenerator";import U from"@babel/runtime/regenerator";import"core-js/modules/esnext.async-iterator.for-each.js";import"core-js/modules/esnext.iterator.constructor.js";import"core-js/modules/esnext.iterator.for-each.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.array.map.js";import"core-js/modules/esnext.async-iterator.map.js";import"core-js/modules/esnext.iterator.map.js";import"core-js/modules/es.object.entries.js";import"core-js/modules/esnext.async-iterator.some.js";import"core-js/modules/esnext.iterator.some.js";import"core-js/modules/es.object.values.js";import"core-js/modules/es.array.find.js";import"core-js/modules/esnext.async-iterator.find.js";import"core-js/modules/esnext.iterator.find.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import S from"@babel/runtime/helpers/esm/toConsumableArray";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.string.starts-with.js";import"core-js/modules/es.string.split.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.array.from.js";import"core-js/modules/es.regexp.test.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.symbol.iterator.js";import"core-js/modules/es.array.flat-map.js";import"core-js/modules/es.array.unscopables.flat-map.js";import"core-js/modules/esnext.async-iterator.flat-map.js";import"core-js/modules/esnext.iterator.flat-map.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/esnext.set.add-all.js";import"core-js/modules/esnext.set.delete-all.js";import"core-js/modules/esnext.set.difference.js";import"core-js/modules/esnext.set.every.js";import"core-js/modules/esnext.set.filter.js";import"core-js/modules/esnext.set.find.js";import"core-js/modules/esnext.set.intersection.js";import"core-js/modules/esnext.set.is-disjoint-from.js";import"core-js/modules/esnext.set.is-subset-of.js";import"core-js/modules/esnext.set.is-superset-of.js";import"core-js/modules/esnext.set.join.js";import"core-js/modules/esnext.set.map.js";import"core-js/modules/esnext.set.reduce.js";import"core-js/modules/esnext.set.some.js";import"core-js/modules/esnext.set.symmetric-difference.js";import"core-js/modules/esnext.set.union.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.join.js";import"core-js/modules/esnext.async-iterator.reduce.js";import"core-js/modules/esnext.iterator.reduce.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.flat.js";import"core-js/modules/es.array.unscopables.flat.js";import C from"md5";import{Writer as D,Parser as q,BlankNode as N,Quad as B}from"n3";import{toRDF as z,fromRDF as L}from"jsonld";import"core-js/modules/es.string.match.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.regexp.sticky.js";import"core-js/modules/es.regexp.to-string.js";function M(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,s=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(s,arguments,u)}else r=s.apply(this,arguments);return n(this,r)}}var Q;!function(e){e.Turtle="Turtle"}(Q||(Q={}));var W=function(n){r(MalformedSolidDocumentError,u);var o=M(MalformedSolidDocumentError);function MalformedSolidDocumentError(r,n,u){var a;return e(this,MalformedSolidDocumentError),a=o.call(this,function(e,t,r){return e?"Malformed ".concat(t," document found at ").concat(e," - ").concat(r):"Malformed ".concat(t," document - ").concat(r)}(r,n,u)),s(t(a),"documentUrl",void 0),s(t(a),"documentFormat",void 0),s(t(a),"malformationDetails",void 0),a.documentUrl=r,a.documentFormat=n,a.malformationDetails=u,a}return MalformedSolidDocumentError}();function F(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,s=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(s,arguments,u)}else r=s.apply(this,arguments);return n(this,r)}}var H=function(n){r(NetworkRequestError,u);var o=F(NetworkRequestError);function NetworkRequestError(r,n){var u;return e(this,NetworkRequestError),u=o.call(this,"Request failed trying to fetch ".concat(r),n),s(t(u),"url",void 0),u.url=r,u}return NetworkRequestError}();function $(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,s=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(s,arguments,u)}else r=s.apply(this,arguments);return n(this,r)}}var J=function(n){r(NotFoundError,u);var o=$(NotFoundError);function NotFoundError(r){var n;return e(this,NotFoundError),n=o.call(this,"Document with '".concat(r,"' url not found")),s(t(n),"url",void 0),n.url=r,n}return NotFoundError}();function _(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,s=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(s,arguments,u)}else r=s.apply(this,arguments);return n(this,r)}}var G=function(n){r(UnauthorizedError,u);var o=_(UnauthorizedError);function UnauthorizedError(r,n){var u;return e(this,UnauthorizedError),u=o.call(this,function(e,t){return"Unauthorized".concat(403===t?" (Forbidden)":"",": ").concat(e)}(r,n)),s(t(u),"url",void 0),s(t(u),"responseStatus",void 0),u.url=r,u.responseStatus=n,u}return P(UnauthorizedError,[{key:"forbidden",get:function(){return void 0!==this.responseStatus?403===this.responseStatus:void 0}}]),UnauthorizedError}(),X={acl:"http://www.w3.org/ns/auth/acl#",foaf:"http://xmlns.com/foaf/0.1/",pim:"http://www.w3.org/ns/pim/space#",purl:"http://purl.org/dc/terms/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"https://schema.org/",solid:"http://www.w3.org/ns/solid/terms#",vcard:"http://www.w3.org/2006/vcard/ns#"};function K(e,t){X[e]=t}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.startsWith("http"))return e;var r=e.split(":"),n=A(r,2),o=n[0],s=n[1];if(o&&s){var u,a,i,c=null!==(u=null!==(a=X[o])&&void 0!==a?a:null===(i=t.extraContext)||void 0===i?void 0:i[o])&&void 0!==u?u:null;if(!c)throw new Error("Can't expand IRI with unknown prefix: '".concat(e,"'"));return c+s}if(!t.defaultPrefix)throw new Error("Can't expand IRI without a default prefix: '".concat(e,"'"));return t.defaultPrefix+o}var Y,Z=function(){function t(r,n){e(this,t),s(this,"url",void 0),s(this,"quads",void 0),this.url=r,this.quads=n}return P(t,[{key:"value",value:function(e){var t;return null===(t=this.quads.find((function(t){return t.predicate.value===V(e)})))||void 0===t?void 0:t.object.value}},{key:"values",value:function(e){return this.quads.filter((function(t){return t.predicate.value===V(e)})).map((function(e){return e.object.value}))}}]),t}(),ee=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e(this,t),s(this,"quads",void 0),this.quads=r}return P(t,[{key:"isEmpty",value:function(){return 0===this.statements.length}},{key:"getQuads",value:function(){return this.quads.slice(0)}},{key:"addQuads",value:function(e){var t;(t=this.quads).push.apply(t,S(e))}},{key:"statements",value:function(e,t,r){var n=this;return this.quads.filter((function(o){return!(r&&o.object.value!==n.expandIRI(r)||e&&o.subject.value!==n.expandIRI(e)||t&&o.predicate.value!==n.expandIRI(t))}))}},{key:"statement",value:function(e,t,r){var n=this,o=this.quads.find((function(o){return!(r&&o.object.value!==n.expandIRI(r)||e&&o.subject.value!==n.expandIRI(e)||t&&o.predicate.value!==n.expandIRI(t))}));return null!=o?o:null}},{key:"contains",value:function(e,t,r){return null!==this.statement(e,t,r)}},{key:"getThing",value:function(e){var t=this.statements(e);return new Z(e,t)}},{key:"expandIRI",value:function(e){return V(e)}}]),t}();function te(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,s=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(s,arguments,u)}else r=s.apply(this,arguments);return n(this,r)}}!function(e){e.Read="read",e.Write="write",e.Append="append",e.Control="control"}(Y||(Y={}));var re=function(n){r(u,ee);var o=te(u);function u(r,n,a){var i;return e(this,u),i=o.call(this,n),s(t(i),"url",void 0),s(t(i),"headers",void 0),i.url=r,i.headers=a,i}return P(u,[{key:"isPersonalProfile",value:function(){return!!this.statement(this.url,V("rdf:type"),V("foaf:PersonalProfileDocument"))}},{key:"isStorage",value:function(){var e;return!(null===(e=this.headers.get("Link"))||void 0===e||!e.match(/<http:\/\/www\.w3\.org\/ns\/pim\/space#Storage>;[^,]+rel="type"/))}},{key:"isUserWritable",value:function(){return this.getUserPermissions().includes(Y.Write)}},{key:"getUserPermissions",value:function(){return this.getPermissionsFromWAC("user")}},{key:"getPublicPermissions",value:function(){return this.getPermissionsFromWAC("public")}},{key:"getLastModified",value:function(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=a(this.headers.get("last-modified")))&&void 0!==r?r:a(null===(n=this.statement(this.url,"purl:modified"))||void 0===n?void 0:n.object.value))&&void 0!==t?t:this.getLatestDocumentDate())&&void 0!==e?e:null}},{key:"expandIRI",value:function(e){return V(e,{defaultPrefix:this.url})}},{key:"getLatestDocumentDate",value:function(){var e=[].concat(S(this.statements(void 0,"purl:modified")),S(this.statements(void 0,"purl:created"))).map((function(e){return a(e.object.value)})).filter((function(e){return null!==e}));return e.length>0?e.reduce((function(e,t){return e>t?e:t})):null}},{key:"getPermissionsFromWAC",value:function(e){var t,r,n,o=null!==(t=this.headers.get("WAC-Allow"))&&void 0!==t?t:"",s=null!==(r=null===(n=i(o,new RegExp("".concat(e,'="([^"]+)"'))))||void 0===n?void 0:n[1])&&void 0!==r?r:"";return c([s.includes("read")&&Y.Read,s.includes("write")&&Y.Write,s.includes("append")&&Y.Append,s.includes("control")&&Y.Control])}}]),u}();function ne(e){return"@graph"in e}function oe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return se(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,u=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){a=!0,s=e},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw s}}}}function se(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}function ue(e,t){return ae.apply(this,arguments)}function ae(){return(ae=O(U.mark((function e(t,r){var n,o,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{Accept:"text/turtle"}},e.prev=1,e.next=4,r(t,n);case 4:if(404!==(o=e.sent).status){e.next=7;break}throw new J(t);case 7:if(![401,403].includes(o.status)){e.next=9;break}throw new G(t,o.status);case 9:return e.next=11,o.text();case 11:return s=e.sent,e.abrupt("return",{body:s,headers:o.headers});case 15:if(e.prev=15,e.t0=e.catch(1),!(e.t0 instanceof G)){e.next=19;break}throw e.t0;case 19:if(!(e.t0 instanceof J)){e.next=21;break}throw e.t0;case 21:throw new H(t,{cause:e.t0});case 22:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function ie(e){var t,r=e.slice(0),n={},o=oe(p(e).flatMap((function(e,t){return d(c(["BlankNode"===e.object.termType?e.object.value:null,"BlankNode"===e.subject.termType?e.subject.value:null]),(function(e){return e.forEach((function(e){var r;return(null!==(r=n[e])&&void 0!==r?r:n[e]=new Set).add(t)}))}))})).filter().unique());try{var s=function(){var o,s=t.value,u=n[s],a=C(p(u).map((function(t){return e[t]})).filter((function(e){var t=e.subject,r=t.termType,n=t.value;return"BlankNode"===r&&n===s})).map((function(e){var t=e.predicate,r=e.object;return"BlankNode"===r.termType?t.value:t.value+r.value})).sorted().join()),i=oe(u);try{for(i.s();!(o=i.n()).done;){for(var c=o.value,l=r[c],f={subject:l.subject,object:l.object},d=0,v=Object.entries(f);d<v.length;d++){var h=A(v[d],2),y=h[0],j=h[1];"BlankNode"===j.termType&&j.value===s&&(f[y]=new N(a))}m(r,l,new B(f.subject,l.predicate,f.object))}}catch(e){i.e(e)}finally{i.f()}};for(o.s();!(t=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return r}function ce(e,t,r){return le.apply(this,arguments)}function le(){return(le=O(U.mark((function e(t,r,n){var o,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(o=n)&&void 0!==o?o:window.fetch.bind(window),e.next=3,Ie(r);case 3:return s=e.sent,e.next=6,n(t,{method:"PUT",headers:{"Content-Type":"text/turtle"},body:r});case 6:return e.abrupt("return",new re(t,s,new Headers({})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fe(e,t){return pe.apply(this,arguments)}function pe(){return(pe=O(U.mark((function e(t,r){var n,o,s,u;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ue(t,null!=r?r:window.fetch);case 2:return n=e.sent,o=n.body,s=n.headers,e.next=7,Ie(o,{documentUrl:t});case 7:return u=e.sent,e.abrupt("return",new re(t,u,s));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(e,t){return me.apply(this,arguments)}function me(){return(me=O(U.mark((function e(t,r){var n;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fe(t,r);case 3:return n=e.sent,e.abrupt("return",n);case 7:if(e.prev=7,e.t0=e.catch(0),e.t0 instanceof J){e.next=11;break}throw e.t0;case 11:return e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function ve(e){return he.apply(this,arguments)}function he(){return(he=O(U.mark((function e(t){var r;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ne(t)){e.next=5;break}return e.next=3,Promise.all(t["@graph"].map(ve));case 3:return r=e.sent,e.abrupt("return",r.flat());case 5:return e.abrupt("return",z(t));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(e){var t=Te(e);return Object.entries(t).reduce((function(e,t){var r=A(t,2),n=r[0],o=r[1].map((function(e){return" "+xe(e)})).sort().join("\n");return e.concat("".concat(n.toUpperCase()," DATA {\n").concat(o,"\n}"))}),[]).join(" ;\n")}function je(e){return be.apply(this,arguments)}function be(){return(be=O(U.mark((function e(t){var r;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L(t);case 2:return r=e.sent,e.abrupt("return",{"@graph":r});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e){return(new D).quadsToString(e)}function xe(e){return(new D).quadsToString([e]).slice(0,-1)}function ge(e,t){return ke.apply(this,arguments)}function ke(){return(ke=O(U.mark((function e(t,r){var n;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fe(t,r);case 3:return n=e.sent,e.abrupt("return",!n.isEmpty());case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function Ee(e){return Re.apply(this,arguments)}function Re(){return Re=O(U.mark((function e(t){var r,n,o,s=arguments;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=l(t,/(\w+) DATA {([^}]+)}/g),o={},e.next=5,Promise.all(S(n).map(function(){var e=O(U.mark((function e(t){var n,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[1].toLowerCase(),s=t[2],e.next=4,Ie(s,r);case 4:o[n]=e.sent;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:return e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)}))),Re.apply(this,arguments)}function Te(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l(e,/(\w+) DATA {([^}]+)}/g),o={},s=oe(n);try{for(s.s();!(t=s.n()).done;){var u=t.value,a=u[1].toLowerCase(),i=u[2];o[a]=Ae(i,r)}}catch(e){s.e(e)}finally{s.f()}return o}function Ie(e){return Pe.apply(this,arguments)}function Pe(){return Pe=O(U.mark((function e(t){var r,n,o,s,u=arguments;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=f({baseIRI:r.documentUrl}),o=new q(n),s=[],e.abrupt("return",new Promise((function(e,n){o.parse(t,(function(t,o){var u;t?n(new W(null!==(u=r.documentUrl)&&void 0!==u?u:null,Q.Turtle,t.message)):o?s.push(o):r.normalizeBlankNodes?e(ie(s)):e(s)}))})));case 5:case"end":return e.stop()}}),e)}))),Pe.apply(this,arguments)}function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=f({baseIRI:t.documentUrl}),n=new q(r);try{var o=n.parse(e);return t.normalizeBlankNodes?ie(o):o}catch(e){var s,u;throw new W(null!==(s=t.documentUrl)&&void 0!==s?s:null,Q.Turtle,null!==(u=e.message)&&void 0!==u?u:"")}}function Oe(e,t,r){return Ue.apply(this,arguments)}function Ue(){return(Ue=O(U.mark((function e(t,r,n){var o;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(o=n)&&void 0!==o?o:window.fetch.bind(window),e.next=3,n(t,{method:"PATCH",headers:{"Content-Type":"application/sparql-update"},body:r});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(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 Ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function De(e,t){return qe.apply(this,arguments)}function qe(){return qe=O(U.mark((function e(t,r){var n,o,u,a,i,c;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=new ee(t.getQuads()),a=s({},t.url,t),i=function(e){return e.statements(void 0,"foaf:isPrimaryTopicOf").map((function(e){return e.object.value})).forEach((function(e){var t;return a[e]=null!==(t=a[e])&&void 0!==t?t:null}))},c=function(){var e=O(U.mark((function e(){var t,n,o,s,c;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,n=Object.entries(a);case 1:if(!(t<n.length)){e.next=23;break}if(o=A(n[t],2),s=o[0],null===o[1]){e.next=5;break}return e.abrupt("continue",20);case 5:return e.prev=5,e.next=8,fe(s,r);case 8:c=e.sent,a[s]=c,u.addQuads(c.getQuads()),i(c),e.next=20;break;case 14:if(e.prev=14,e.t0=e.catch(5),!(e.t0 instanceof G)){e.next=19;break}return a[s]=!1,e.abrupt("continue",20);case 19:throw e.t0;case 20:t++,e.next=1;break;case 23:case"end":return e.stop()}}),e,null,[[5,14]])})));return function(){return e.apply(this,arguments)}}(),i(t);case 5:return e.next=7,c();case 7:if(Object.values(a).some((function(e){return null===e}))){e.next=5;break}case 8:return e.abrupt("return",{store:u,cloaked:Object.values(a).some((function(e){return!1===e})),writableProfileUrl:t.isUserWritable()?t.url:null!==(n=null===(o=Object.values(a).find((function(e){return!!e&&e.isUserWritable()})))||void 0===o?void 0:o.url)&&void 0!==n?n:null});case 9:case"end":return e.stop()}}),e)}))),qe.apply(this,arguments)}function Ne(e,t){return Be.apply(this,arguments)}function Be(){return(Be=O(U.mark((function e(t,r){var n,o,s,u,a,i,c,l,p,d,m,v,b,w,x,g,k,E;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=j(t),e.next=3,fe(l,r);case 3:if((p=e.sent).isPersonalProfile()||p.contains(t,"solid:oidcIssuer")){e.next=6;break}throw new Error("".concat(t," is not a valid webId."));case 6:return e.next=8,De(p,r);case 8:d=e.sent,m=d.store,v=d.writableProfileUrl,b=d.cloaked,w=m.statements(t,"pim:storage").map((function(e){return e.object.value})),x=m.statement(t,"solid:publicTypeIndex"),g=m.statement(t,"solid:privateTypeIndex"),k=y(l);case 16:if(!k||0!==w.length){e.next=26;break}return e.next=19,h(fe(k,r));case 19:if(null==(E=e.sent)||!E.isStorage()){e.next=23;break}return w.push(k),e.abrupt("break",26);case 23:k=y(k),e.next=16;break;case 26:return e.abrupt("return",Ce({webId:t,storageUrls:w,cloaked:b,writableProfileUrl:v},f({name:null!==(n=null===(o=m.statement(t,"vcard:fn"))||void 0===o?void 0:o.object.value)&&void 0!==n?n:null===(s=m.statement(t,"foaf:name"))||void 0===s?void 0:s.object.value,avatarUrl:null!==(u=null===(a=m.statement(t,"vcard:hasPhoto"))||void 0===a?void 0:a.object.value)&&void 0!==u?u:null===(i=m.statement(t,"foaf:img"))||void 0===i?void 0:i.object.value,oidcIssuerUrl:null===(c=m.statement(t,"solid:oidcIssuer"))||void 0===c?void 0:c.object.value,publicTypeIndexUrl:null==x?void 0:x.object.value,privateTypeIndexUrl:null==g?void 0:g.object.value})));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(e,t){return Le.apply(this,arguments)}function Le(){return(Le=O(U.mark((function e(t,r){var n,o,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=h((function(e){return Ne(e,r)})),e.next=3,s(t);case 3:if(e.t2=o=e.sent,e.t1=null!==e.t2,!e.t1){e.next=7;break}e.t1=void 0!==o;case 7:if(!e.t1){e.next=11;break}e.t3=o,e.next=14;break;case 11:return e.next=13,s(t.replace(/\/$/,"").concat("/profile/card#me"));case 13:e.t3=e.sent;case 14:if(e.t4=n=e.t3,e.t0=null!==e.t4,!e.t0){e.next=18;break}e.t0=void 0!==n;case 18:if(!e.t0){e.next=22;break}e.t5=n,e.next=25;break;case 22:return e.next=24,s(v(t).concat("/profile/card#me"));case 24:e.t5=e.sent;case 25:return e.abrupt("return",e.t5);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(e){var t=function(e){return e.path&&e.path.startsWith("/")?e.path.match(/^\/[^/]*$/)?"/":"/".concat(p(e.path.split("/")).filter().slice(0,-1).join("/"),"/").replace("//","/"):null}(e);return e.protocol&&e.domain?"".concat(e.protocol,"://").concat(e.domain).concat(null!=t?t:"/"):t}function Qe(e){var t;if("@type"in e&&!("@value"in e)){e["@id"]=null!==(t=e["@id"])&&void 0!==t?t:x();for(var r=0,n=Object.values(e);r<n.length;r++){var o=n[r];g(o)&&Qe(o),k(o)&&o.forEach((function(e){return g(e)&&Qe(e)}))}}}function We(e){return d(b(e),(function(e){return Qe(e)}))}function Fe(e){var t=w(e);return t?f({containerUrl:Me(t),documentName:t.path?t.path.split("/").pop():null,resourceHash:t.fragment}):{}}function He(e,t){return $e.apply(this,arguments)}function $e(){return($e=O(U.mark((function e(t,r){var n,o,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null!==(n=r)&&void 0!==n?n:window.fetch.bind(r),o=t.storageUrls[0],s="".concat(o,"settings/privateTypeIndex"),e.next=5,ge(s,r);case 5:if(!e.sent){e.next=9;break}e.t0="".concat(o,"settings/privateTypeIndex-").concat(x()),e.next=10;break;case 9:e.t0=s;case 10:return e.abrupt("return",e.t0);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Je(e,t){return _e.apply(this,arguments)}function _e(){return(_e=O(U.mark((function e(t,r){var n,o,s;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.writableProfileUrl){e.next=2;break}throw new Error("Can't create type index without a writable profile document");case 2:return r=null!==(n=r)&&void 0!==n?n:window.fetch.bind(r),e.next=5,He(t,r);case 5:return o=e.sent,"\n <> a\n <http://www.w3.org/ns/solid/terms#TypeIndex>,\n <http://www.w3.org/ns/solid/terms#UnlistedDocument> .\n ",s="\n INSERT DATA {\n <".concat(t.webId,"> <http://www.w3.org/ns/solid/terms#privateTypeIndex> <").concat(o,"> .\n }\n "),e.next=10,Promise.all([ce(o,"\n <> a\n <http://www.w3.org/ns/solid/terms#TypeIndex>,\n <http://www.w3.org/ns/solid/terms#UnlistedDocument> .\n ",r),Oe(t.writableProfileUrl,s,r)]);case 10:return e.abrupt("return",o);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e,t,r){return Xe.apply(this,arguments)}function Xe(){return(Xe=O(U.mark((function e(t,r,n){var o,s,u;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe(t,n);case 2:return s=e.sent,u=s.statements(void 0,"rdf:type","solid:TypeRegistration").find((function(e){return s.contains(e.subject.value,"solid:forClass",r)&&s.contains(e.subject.value,"solid:instanceContainer")})),e.abrupt("return",u&&null!==(o=s.getThing(u.subject.value))&&void 0!==o?o:null);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ke(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ve(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 s,u=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){a=!0,s=e},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw s}}}}function Ve(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}function Ye(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,s=o(e);if(t){var u=o(this).constructor;r=Reflect.construct(s,arguments,u)}else r=s.apply(this,arguments);return n(this,r)}}var Ze={},et={"%uuid%":"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},tt=function(n){r(ExpectedQuadAssertionError,u);var o=Ye(ExpectedQuadAssertionError);function ExpectedQuadAssertionError(r){var n;return e(this,ExpectedQuadAssertionError),n=o.call(this,"Couldn't find the following triple: ".concat(xe(r))),s(t(n),"expectedQuad",void 0),n.expectedQuad=r,n}return ExpectedQuadAssertionError}();function rt(e,t){var r,n=Ke(e);try{var o=function(){var e=r.value,n=t.find((function(t){return n=t,function(e,t){if(e.termType!==t.termType)return!1;if("Literal"===e.termType&&"Literal"===t.termType){if(e.datatype.value!==t.datatype.value)return!1;if(!nt(e.value))return"http://www.w3.org/2001/XMLSchema#dateTime"===e.datatype.value?new Date(e.value).getTime()===new Date(t.value).getTime():e.value===t.value}return ot(e.value,t.value)}((r=e).object,n.object)&&ot(r.subject.value,n.subject.value)&&ot(r.predicate.value,n.predicate.value);var r,n}));if(!n)throw new tt(e);R(t,n)};for(n.s();!(r=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}}function nt(e){return/\[\[(.*\]\[)?([^\]]+)\]\]/.test(e)}function ot(e,t){var r,n;return nt(e)?(null!==(n=(r=Ze)[e])&&void 0!==n?n:r[e]=function(e){var t,r=[],n=[],o=e,s=Ke(l(e,/\[\[((.*?)\]\[)?([^\]]+)\]\]/g));try{for(s.s();!(t=s.n()).done;){var u=t.value;u[2]&&r.push(u[2]),n.push(u[3]),o=o.replace(u[0],"%PATTERN".concat(n.length-1,"%"))}}catch(e){s.e(e)}finally{s.f()}o=o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");for(var a=0,i=Object.entries(n);a<i.length;a++){var c,f=A(i[a],2),p=f[0],d=f[1];o=o.replace("%PATTERN".concat(p,"%"),null!==(c=et[d])&&void 0!==c?c:d)}return new RegExp(o)}(e)).test(t):e===t}function st(){Ze={}}function ut(e,t){return at.apply(this,arguments)}function at(){return(at=O(U.mark((function e(t,r){var n,o,s,u,a;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return st(),e.next=3,ve(t);case 3:return n=e.sent,e.next=6,ve(r);case 6:if(o=e.sent,s=we(n),u=we(o),a=function(e,t){return{success:e,message:t,expected:s,actual:u}},n.length===o.length){e.next=12;break}return e.abrupt("return",a(!1,"Expected ".concat(n.length," triples, found ").concat(o.length,".")));case 12:e.prev=12,rt(n,o),e.next=21;break;case 16:if(e.prev=16,e.t0=e.catch(12),e.t0 instanceof tt){e.next=20;break}throw e.t0;case 20:return e.abrupt("return",a(!1,e.t0.message));case 21:return e.abrupt("return",a(!0,"jsonld matches"));case 22:case"end":return e.stop()}}),e,null,[[12,16]])})))).apply(this,arguments)}function it(e,t){var r;st();for(var n=Te(e,{normalizeBlankNodes:!0}),o=Te(t,{normalizeBlankNodes:!0}),s=function(r,n){return{success:r,message:n,expected:e,actual:t}},u=0,a=Object.keys(n);u<a.length;u++){var i=a[u];if(!(i in o))return s(!1,"Couldn't find expected ".concat(i," operation."));var c=E(n,i),l=E(o,i);if(c.length!==l.length)return s(!1,"Expected ".concat(c.length," ").concat(i," triples, found ").concat(l.length,"."));try{rt(c,l)}catch(e){if(!(e instanceof tt))throw e;return s(!1,"Couldn't find the following ".concat(i," triple: ").concat(xe(e.expectedQuad)))}}var f=null!==(r=Object.keys(o)[0])&&void 0!==r?r:null;return f?s(!1,"Did not expect to find ".concat(f," triples.")):s(!0,"sparql matches")}function ct(e,t){st();var r=Ae(e,{normalizeBlankNodes:!0}),n=Ae(t,{normalizeBlankNodes:!0}),o=function(r,n){return{success:r,message:n,expected:e,actual:t}};if(r.length!==n.length)return o(!1,"Expected ".concat(r.length," triples, found ").concat(n.length,"."));try{rt(r,n)}catch(e){if(!(e instanceof tt))throw e;return o(!1,e.message)}return o(!0,"turtle matches")}function lt(e,t){return ft.apply(this,arguments)}function ft(){return(ft=O(U.mark((function e(t,r){var n,o,s,u,a,i,c;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null!==(n=r)&&void 0!==n?n:window.fetch.bind(window),e.next=3,r(t,{method:"HEAD"});case 3:if(a=e.sent,i=null!==(o=a.headers.get("Link"))&&void 0!==o?o:"",c=null!==(s=null===(u=i.match(/<([^>]+)>;\s*rel="acl"/))||void 0===u?void 0:u[1])&&void 0!==s?s:null){e.next=8;break}throw new Error("Could not find ACL Resource for '".concat(t,"'"));case 8:return e.abrupt("return",T(I(t),c));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(e,t,r){return dt.apply(this,arguments)}function dt(){return(dt=O(U.mark((function e(t,r,n){var o,s,u;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(o=n)||void 0===o){e.next=4;break}e.t0=o,e.next=7;break;case 4:return e.next=6,lt(t,r);case 6:e.t0=e.sent;case 7:return n=e.t0,e.next=10,de(null!==(u=n)&&void 0!==u?u:"",r);case 10:if(e.t2=s=e.sent,e.t1=null!==e.t2,!e.t1){e.next=14;break}e.t1=void 0!==s;case 14:if(!e.t1){e.next=18;break}e.t3=s,e.next=21;break;case 18:return e.next=20,pt(I(t),r);case 20:e.t3=e.sent;case 21:return e.abrupt("return",e.t3);case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mt(e,t){return vt.apply(this,arguments)}function vt(){return(vt=O(U.mark((function e(t,r){var n,o;return U.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lt(t,r);case 2:return n=e.sent,e.next=5,pt(t,r,n);case 5:return o=e.sent,e.abrupt("return",f({url:n,effectiveUrl:o.url,document:o}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ht={turtle:function(e){var t=this._obj,r=this.assert.bind(this),n=ct(e,t);r(n.success,n.message,"",n.expected,n.actual)},sparql:function(e){var t=this._obj,r=this.assert.bind(this),n=it(e,t);r(n.success,n.message,"",n.expected,n.actual)}};function yt(){chai.use((function(e){return Object.entries(ht).forEach((function(t){var r=A(t,2),n=r[0],o=r[1];return e.Assertion.addMethod(n,o)}))}))}function jt(e,t){var r=e.success,n=t.context.utils;return{pass:r,message:r?function(){return[e.message,n.matcherHint(t.hint)].join("\n\n")}:function(){return[e.message,n.matcherHint(t.hint),["Expected: not ".concat(n.printExpected(t.expected)),"Received: ".concat(n.printReceived(t.received))].join("\n")].join("\n\n")}}}var bt={toEqualJsonLD:function(e,t){var r=this;return O(U.mark((function n(){var o;return U.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,ut(t,e);case 2:return o=n.sent,n.abrupt("return",jt(o,{context:r,hint:"toEqualJsonLD",expected:t,received:e}));case 4:case"end":return n.stop()}}),n)})))()},toEqualSparql:function(e,t){return jt(it(t,e),{context:this,hint:"toEqualSparql",expected:ye(t),received:ye(e)})}};function wt(){expect.extend(bt)}export{W as MalformedSolidDocumentError,H as NetworkRequestError,J as NotFoundError,re as SolidDocument,Q as SolidDocumentFormat,Y as SolidDocumentPermission,ee as SolidStore,Z as SolidThing,G as UnauthorizedError,Je as createPrivateTypeIndex,ce as createSolidDocument,K as defineIRIPrefix,V as expandIRI,ze as fetchLoginUserProfile,fe as fetchSolidDocument,mt as fetchSolidDocumentACL,de as fetchSolidDocumentIfFound,Ge as findContainerRegistration,yt as installChaiPlugin,wt as installJestPlugin,ne as isJsonLDGraph,ut as jsonldEquals,ve as jsonldToQuads,We as mintJsonLDIdentifiers,ye as normalizeSparql,Fe as parseResourceSubject,xe as quadToTurtle,je as quadsToJsonLD,we as quadsToTurtle,ge as solidDocumentExists,it as sparqlEquals,Ee as sparqlToQuads,Te as sparqlToQuadsSync,ct as turtleEquals,Ie as turtleToQuads,Ae as turtleToQuadsSync,Oe as updateSolidDocument};
1
+ import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.to-string-tag.js";import"core-js/modules/es.reflect.construct.js";import e from"@babel/runtime/helpers/esm/classCallCheck";import t from"@babel/runtime/helpers/esm/assertThisInitialized";import r from"@babel/runtime/helpers/esm/inherits";import n from"@babel/runtime/helpers/esm/possibleConstructorReturn";import o from"@babel/runtime/helpers/esm/getPrototypeOf";import u from"@babel/runtime/helpers/esm/defineProperty";import"core-js/modules/es.array.concat.js";import{JSError as s,parseDate as a,stringMatch as c,arrayFilter as i,objectWithoutEmpty as l,stringMatchAll as f,arr as p,tap as d,arrayReplace as m,urlRoot as v,silenced as h,urlParentDirectory as y,urlRoute as b,objectDeepClone as j,urlParse as w,uuid as x,isObject as g,isArray as k,pull as R,arrayRemove as E,urlResolve as I,requireUrlParentDirectory as P}from"@noeldemartin/utils";import A from"@babel/runtime/helpers/esm/createClass";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/esnext.async-iterator.filter.js";import"core-js/modules/esnext.iterator.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import T from"@babel/runtime/helpers/esm/slicedToArray";import U from"@babel/runtime/helpers/esm/asyncToGenerator";import O from"@babel/runtime/regenerator";import"core-js/modules/esnext.async-iterator.for-each.js";import"core-js/modules/esnext.iterator.constructor.js";import"core-js/modules/esnext.iterator.for-each.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.array.map.js";import"core-js/modules/esnext.async-iterator.map.js";import"core-js/modules/esnext.iterator.map.js";import"core-js/modules/es.object.entries.js";import"core-js/modules/esnext.async-iterator.some.js";import"core-js/modules/esnext.iterator.some.js";import"core-js/modules/es.object.values.js";import"core-js/modules/es.array.find.js";import"core-js/modules/esnext.async-iterator.find.js";import"core-js/modules/esnext.iterator.find.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import q from"@babel/runtime/helpers/esm/toConsumableArray";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.string.starts-with.js";import"core-js/modules/es.string.split.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.array.from.js";import"core-js/modules/es.regexp.test.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.symbol.iterator.js";import"core-js/modules/es.array.flat-map.js";import"core-js/modules/es.array.unscopables.flat-map.js";import"core-js/modules/esnext.async-iterator.flat-map.js";import"core-js/modules/esnext.iterator.flat-map.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/esnext.set.add-all.js";import"core-js/modules/esnext.set.delete-all.js";import"core-js/modules/esnext.set.difference.js";import"core-js/modules/esnext.set.every.js";import"core-js/modules/esnext.set.filter.js";import"core-js/modules/esnext.set.find.js";import"core-js/modules/esnext.set.intersection.js";import"core-js/modules/esnext.set.is-disjoint-from.js";import"core-js/modules/esnext.set.is-subset-of.js";import"core-js/modules/esnext.set.is-superset-of.js";import"core-js/modules/esnext.set.join.js";import"core-js/modules/esnext.set.map.js";import"core-js/modules/esnext.set.reduce.js";import"core-js/modules/esnext.set.some.js";import"core-js/modules/esnext.set.symmetric-difference.js";import"core-js/modules/esnext.set.union.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.join.js";import"core-js/modules/esnext.async-iterator.reduce.js";import"core-js/modules/esnext.iterator.reduce.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.array.flat.js";import"core-js/modules/es.array.unscopables.flat.js";import C from"md5";import{compactJsonLD as S,jsonLDToRDF as D,TurtleParser as B,jsonLDFromRDF as N,TurtleWriter as z,createBlankNode as L,createQuad as M}from"@noeldemartin/solid-utils-external";import"core-js/modules/es.string.match.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.regexp.sticky.js";import"core-js/modules/es.regexp.to-string.js";function Q(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var W;!function(e){e.Turtle="Turtle"}(W||(W={}));var F=function(n){r(MalformedSolidDocumentError,s);var o=Q(MalformedSolidDocumentError);function MalformedSolidDocumentError(r,n,s){var a;return e(this,MalformedSolidDocumentError),a=o.call(this,function(e,t,r){return e?"Malformed ".concat(t," document found at ").concat(e," - ").concat(r):"Malformed ".concat(t," document - ").concat(r)}(r,n,s)),u(t(a),"documentUrl",void 0),u(t(a),"documentFormat",void 0),u(t(a),"malformationDetails",void 0),a.documentUrl=r,a.documentFormat=n,a.malformationDetails=s,a}return MalformedSolidDocumentError}();function H(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var $=function(n){r(NetworkRequestError,s);var o=H(NetworkRequestError);function NetworkRequestError(r,n){var s;return e(this,NetworkRequestError),s=o.call(this,"Request failed trying to fetch ".concat(r),n),u(t(s),"url",void 0),s.url=r,s}return NetworkRequestError}();function _(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var J=function(n){r(NotFoundError,s);var o=_(NotFoundError);function NotFoundError(r){var n;return e(this,NotFoundError),n=o.call(this,"Document with '".concat(r,"' url not found")),u(t(n),"url",void 0),n.url=r,n}return NotFoundError}();function G(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var X=function(n){r(UnauthorizedError,s);var o=G(UnauthorizedError);function UnauthorizedError(r,n){var s;return e(this,UnauthorizedError),s=o.call(this,function(e,t){return"Unauthorized".concat(403===t?" (Forbidden)":"",": ").concat(e)}(r,n)),u(t(s),"url",void 0),u(t(s),"responseStatus",void 0),s.url=r,s.responseStatus=n,s}return A(UnauthorizedError,[{key:"forbidden",get:function(){return void 0!==this.responseStatus?403===this.responseStatus:void 0}}]),UnauthorizedError}();function K(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var V=function(n){r(UnsuccessfulRequestError,s);var o=K(UnsuccessfulRequestError);function UnsuccessfulRequestError(r,n){var s;return e(this,UnsuccessfulRequestError),s=o.call(this,function(e,t){var r;return t=null!==(r=t)&&void 0!==r?r:e,"string"==typeof e?"".concat(e," (returned ").concat(t.status," status code)"):"Request to ".concat(t.url," returned ").concat(t.status," status code")}(r,n)),u(t(s),"response",void 0),s.response=null!=n?n:r,s}return UnsuccessfulRequestError}();function Y(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var Z=function(n){r(UnsupportedAuthorizationProtocolError,s);var o=Y(UnsupportedAuthorizationProtocolError);function UnsupportedAuthorizationProtocolError(r,n,s){var a;return e(this,UnsupportedAuthorizationProtocolError),a=o.call(this,"The resource at ".concat(r," is using an unsupported authorization protocol (").concat(n,")"),s),u(t(a),"url",void 0),u(t(a),"protocol",void 0),a.url=r,a.protocol=n,a}return UnsupportedAuthorizationProtocolError}(),ee={acl:"http://www.w3.org/ns/auth/acl#",foaf:"http://xmlns.com/foaf/0.1/",pim:"http://www.w3.org/ns/pim/space#",purl:"http://purl.org/dc/terms/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"https://schema.org/",solid:"http://www.w3.org/ns/solid/terms#",vcard:"http://www.w3.org/2006/vcard/ns#"};function te(e,t){ee[e]=t}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.startsWith("http"))return e;var r=e.split(":"),n=T(r,2),o=n[0],u=n[1];if(o&&u){var s,a,c,i=null!==(s=null!==(a=ee[o])&&void 0!==a?a:null===(c=t.extraContext)||void 0===c?void 0:c[o])&&void 0!==s?s:null;if(!i)throw new Error("Can't expand IRI with unknown prefix: '".concat(e,"'"));return i+u}if(!t.defaultPrefix)throw new Error("Can't expand IRI without a default prefix: '".concat(e,"'"));return t.defaultPrefix+o}var ne,oe=function(){function t(r,n){e(this,t),u(this,"url",void 0),u(this,"quads",void 0),this.url=r,this.quads=n}return A(t,[{key:"value",value:function(e){var t;return null===(t=this.quads.find((function(t){return t.predicate.value===re(e)})))||void 0===t?void 0:t.object.value}},{key:"values",value:function(e){return this.quads.filter((function(t){return t.predicate.value===re(e)})).map((function(e){return e.object.value}))}}]),t}(),ue=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e(this,t),u(this,"quads",void 0),this.quads=r}return A(t,[{key:"isEmpty",value:function(){return 0===this.statements.length}},{key:"getQuads",value:function(){return this.quads.slice(0)}},{key:"addQuads",value:function(e){var t;(t=this.quads).push.apply(t,q(e))}},{key:"statements",value:function(e,t,r){var n=this;return this.quads.filter((function(o){return!(r&&o.object.value!==n.expandIRI(r)||e&&o.subject.value!==n.expandIRI(e)||t&&o.predicate.value!==n.expandIRI(t))}))}},{key:"statement",value:function(e,t,r){var n=this,o=this.quads.find((function(o){return!(r&&o.object.value!==n.expandIRI(r)||e&&o.subject.value!==n.expandIRI(e)||t&&o.predicate.value!==n.expandIRI(t))}));return null!=o?o:null}},{key:"contains",value:function(e,t,r){return null!==this.statement(e,t,r)}},{key:"getThing",value:function(e){var t=this.statements(e);return new oe(e,t)}},{key:"expandIRI",value:function(e){return re(e)}}]),t}();function se(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}!function(e){e.Read="read",e.Write="write",e.Append="append",e.Control="control"}(ne||(ne={}));var ae=function(n){r(s,ue);var o=se(s);function s(r,n,a){var c;return e(this,s),c=o.call(this,n),u(t(c),"url",void 0),u(t(c),"headers",void 0),c.url=r,c.headers=a,c}return A(s,[{key:"isACPResource",value:function(){var e;return!(null===(e=this.headers.get("Link"))||void 0===e||!e.match(/<http:\/\/www\.w3\.org\/ns\/solid\/acp#AccessControlResource>;[^,]+rel="type"/))}},{key:"isPersonalProfile",value:function(){return!!this.statement(this.url,re("rdf:type"),re("foaf:PersonalProfileDocument"))}},{key:"isStorage",value:function(){var e;return!(null===(e=this.headers.get("Link"))||void 0===e||!e.match(/<http:\/\/www\.w3\.org\/ns\/pim\/space#Storage>;[^,]+rel="type"/))}},{key:"isUserWritable",value:function(){return this.getUserPermissions().includes(ne.Write)}},{key:"getUserPermissions",value:function(){return this.getPermissionsFromWAC("user")}},{key:"getPublicPermissions",value:function(){return this.getPermissionsFromWAC("public")}},{key:"getLastModified",value:function(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=a(this.headers.get("last-modified")))&&void 0!==r?r:a(null===(n=this.statement(this.url,"purl:modified"))||void 0===n?void 0:n.object.value))&&void 0!==t?t:this.getLatestDocumentDate())&&void 0!==e?e:null}},{key:"expandIRI",value:function(e){return re(e,{defaultPrefix:this.url})}},{key:"getLatestDocumentDate",value:function(){var e=[].concat(q(this.statements(void 0,"purl:modified")),q(this.statements(void 0,"purl:created"))).map((function(e){return a(e.object.value)})).filter((function(e){return null!==e}));return e.length>0?e.reduce((function(e,t){return e>t?e:t})):null}},{key:"getPermissionsFromWAC",value:function(e){var t,r,n,o=null!==(t=this.headers.get("WAC-Allow"))&&void 0!==t?t:"",u=null!==(r=null===(n=c(o,new RegExp("".concat(e,'="([^"]+)"'))))||void 0===n?void 0:n[1])&&void 0!==r?r:"";return i([u.includes("read")&&ne.Read,u.includes("write")&&ne.Write,u.includes("append")&&ne.Append,u.includes("control")&&ne.Control])}}]),s}();function ce(e){return ie.apply(this,arguments)}function ie(){return(ie=U(O.mark((function e(t){var r;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(t,{});case 2:if(!("@graph"in(r=e.sent))){e.next=5;break}return e.abrupt("return",r);case 5:if(!("@id"in r)){e.next=7;break}return e.abrupt("return",{"@graph":[r]});case 7:return e.abrupt("return",{"@graph":[]});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function le(e){return"@graph"in e}function fe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return pe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pe(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 u,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,u=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw u}}}}function pe(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}function de(e,t){return me.apply(this,arguments)}function me(){return(me=U(O.mark((function e(t,r){var n,o,u;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{Accept:"text/turtle"}},e.prev=1,e.next=4,r(t,n);case 4:if(404!==(o=e.sent).status){e.next=7;break}throw new J(t);case 7:if(![401,403].includes(o.status)){e.next=9;break}throw new X(t,o.status);case 9:return e.next=11,o.text();case 11:return u=e.sent,e.abrupt("return",{body:u,headers:o.headers});case 15:if(e.prev=15,e.t0=e.catch(1),!(e.t0 instanceof X)){e.next=19;break}throw e.t0;case 19:if(!(e.t0 instanceof J)){e.next=21;break}throw e.t0;case 21:throw new $(t,{cause:e.t0});case 22:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function ve(e){var t,r=e.slice(0),n={},o=fe(p(e).flatMap((function(e,t){return d(i(["BlankNode"===e.object.termType?e.object.value:null,"BlankNode"===e.subject.termType?e.subject.value:null]),(function(e){return e.forEach((function(e){var r;return(null!==(r=n[e])&&void 0!==r?r:n[e]=new Set).add(t)}))}))})).filter().unique());try{var u=function(){var o,u=t.value,s=n[u],a=C(p(s).map((function(t){return e[t]})).filter((function(e){var t=e.subject,r=t.termType,n=t.value;return"BlankNode"===r&&n===u})).map((function(e){var t=e.predicate,r=e.object;return"BlankNode"===r.termType?t.value:t.value+r.value})).sorted().join()),c=fe(s);try{for(c.s();!(o=c.n()).done;){for(var i=o.value,l=r[i],f={subject:l.subject,object:l.object},d=0,v=Object.entries(f);d<v.length;d++){var h=T(v[d],2),y=h[0],b=h[1];"BlankNode"===b.termType&&b.value===u&&(f[y]=L(a))}m(r,l,M(f.subject,l.predicate,f.object))}}catch(e){c.e(e)}finally{c.f()}};for(o.s();!(t=o.n()).done;)u()}catch(e){o.e(e)}finally{o.f()}return r}function he(e,t,r){return ye.apply(this,arguments)}function ye(){return(ye=U(O.mark((function e(t,r,n){var o,u;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(o=n)&&void 0!==o?o:window.fetch.bind(window),e.next=3,De(r);case 3:return u=e.sent,e.next=6,n(t,{method:"PUT",headers:{"Content-Type":"text/turtle"},body:r});case 6:return e.abrupt("return",new ae(t,u,new Headers({})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(e,t){return je.apply(this,arguments)}function je(){return(je=U(O.mark((function e(t,r){var n,o,u,s;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,de(t,null!=r?r:window.fetch);case 2:return n=e.sent,o=n.body,u=n.headers,e.next=7,De(o,{baseIRI:t});case 7:return s=e.sent,e.abrupt("return",new ae(t,s,u));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e,t){return xe.apply(this,arguments)}function xe(){return(xe=U(O.mark((function e(t,r){var n;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,be(t,r);case 3:return n=e.sent,e.abrupt("return",n);case 7:if(e.prev=7,e.t0=e.catch(0),e.t0 instanceof J){e.next=11;break}throw e.t0;case 11:return e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function ge(e,t){return ke.apply(this,arguments)}function ke(){return(ke=U(O.mark((function e(t,r){var n;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!le(t)){e.next=5;break}return e.next=3,Promise.all(t["@graph"].map((function(e){return ge(e,r)})));case 3:return n=e.sent,e.abrupt("return",n.flat());case 5:return e.abrupt("return",D(t,{base:r}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(e){var t=Se(e);return Object.entries(t).reduce((function(e,t){var r=T(t,2),n=r[0],o=r[1].map((function(e){return" "+Te(e)})).sort().join("\n");return e.concat("".concat(n.toUpperCase()," DATA {\n").concat(o,"\n}"))}),[]).join(" ;\n")}function Ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=l({baseIRI:t.baseIRI}),n=new B(r),o={quads:[],containsRelativeIRIs:!1};return new Promise((function(r,u){var s=n._resolveRelativeIRI;n._resolveRelativeIRI=function(){return o.containsRelativeIRIs=!0,n._resolveRelativeIRI=s,n._resolveRelativeIRI.apply(n,arguments)},n.parse(e,(function(e,n){var s;e?u(new F(null!==(s=t.baseIRI)&&void 0!==s?s:null,W.Turtle,e.message)):n?o.quads.push(n):r(o)}))}))}function Ie(e){return Pe.apply(this,arguments)}function Pe(){return(Pe=U(O.mark((function e(t){var r;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N(t);case 2:return r=e.sent,e.abrupt("return",{"@graph":r});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(e){return(new z).quadsToString(e)}function Te(e){return(new z).quadsToString([e]).slice(0,-1)}function Ue(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=U(O.mark((function e(t,r){var n;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,be(t,r);case 3:return n=e.sent,e.abrupt("return",!n.isEmpty());case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function qe(e){return Ce.apply(this,arguments)}function Ce(){return Ce=U(O.mark((function e(t){var r,n,o,u=arguments;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},n=f(t,/(\w+) DATA {([^}]+)}/g),o={},e.next=5,Promise.all(q(n).map(function(){var e=U(O.mark((function e(t){var n,u;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[1].toLowerCase(),u=t[2],e.next=4,De(u,r);case 4:o[n]=e.sent;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:return e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)}))),Ce.apply(this,arguments)}function Se(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=f(e,/(\w+) DATA {([^}]+)}/g),o={},u=fe(n);try{for(u.s();!(t=u.n()).done;){var s=t.value,a=s[1].toLowerCase(),c=s[2];o[a]=Ne(c,r)}}catch(e){u.e(e)}finally{u.f()}return o}function De(e){return Be.apply(this,arguments)}function Be(){return Be=U(O.mark((function e(t){var r,n,o,u=arguments;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},e.next=3,Ee(t,r);case 3:return n=e.sent,o=n.quads,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)}))),Be.apply(this,arguments)}function Ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=l({baseIRI:t.baseIRI}),n=new B(r);try{var o=n.parse(e);return t.normalizeBlankNodes?ve(o):o}catch(e){var u,s;throw new F(null!==(u=t.baseIRI)&&void 0!==u?u:null,W.Turtle,null!==(s=e.message)&&void 0!==s?s:"")}}function ze(e,t,r){return Le.apply(this,arguments)}function Le(){return(Le=U(O.mark((function e(t,r,n){var o;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(o=n)&&void 0!==o?o:window.fetch.bind(window),e.next=3,n(t,{method:"PATCH",headers:{"Content-Type":"application/sparql-update"},body:r});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(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 Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function We(e,t){return Fe.apply(this,arguments)}function Fe(){return Fe=U(O.mark((function e(t,r){var n,o,s,a,c,i;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=new ue(t.getQuads()),a=u({},t.url,t),c=function(e){e.statements(void 0,"foaf:isPrimaryTopicOf").map((function(e){return e.object.value})).forEach((function(e){var t;return a[e]=null!==(t=a[e])&&void 0!==t?t:null})),e.statements(void 0,"foaf:primaryTopic").map((function(e){return e.object.value})).forEach((function(e){var t;return a[e]=null!==(t=a[e])&&void 0!==t?t:null}))},i=function(){var e=U(O.mark((function e(){var t,n,o,u,i;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,n=Object.entries(a);case 1:if(!(t<n.length)){e.next=23;break}if(o=T(n[t],2),u=o[0],null===o[1]){e.next=5;break}return e.abrupt("continue",20);case 5:return e.prev=5,e.next=8,be(u,r);case 8:i=e.sent,a[u]=i,s.addQuads(i.getQuads()),c(i),e.next=20;break;case 14:if(e.prev=14,e.t0=e.catch(5),!(e.t0 instanceof X)){e.next=19;break}return a[u]=!1,e.abrupt("continue",20);case 19:throw e.t0;case 20:t++,e.next=1;break;case 23:case"end":return e.stop()}}),e,null,[[5,14]])})));return function(){return e.apply(this,arguments)}}(),c(t);case 5:return e.next=7,i();case 7:if(Object.values(a).some((function(e){return null===e}))){e.next=5;break}case 8:return e.abrupt("return",{store:s,cloaked:Object.values(a).some((function(e){return!1===e})),writableProfileUrl:t.isUserWritable()?t.url:null!==(n=null===(o=Object.values(a).find((function(e){return!!e&&e.isUserWritable()})))||void 0===o?void 0:o.url)&&void 0!==n?n:null});case 9:case"end":return e.stop()}}),e)}))),Fe.apply(this,arguments)}function He(e,t){return $e.apply(this,arguments)}function $e(){return($e=U(O.mark((function e(t,r){var n,o,u,s,a,c,i,f,p,d,m,v,j,w,x,g,k,R;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=b(t),e.next=3,be(f,r);case 3:if((p=e.sent).isPersonalProfile()||p.contains(t,"solid:oidcIssuer")){e.next=6;break}throw new Error("".concat(t," is not a valid webId."));case 6:return e.next=8,We(p,r);case 8:d=e.sent,m=d.store,v=d.writableProfileUrl,j=d.cloaked,w=m.statements(t,"pim:storage").map((function(e){return e.object.value})),x=m.statement(t,"solid:publicTypeIndex"),g=m.statement(t,"solid:privateTypeIndex"),k=y(f);case 16:if(!k||0!==w.length){e.next=26;break}return e.next=19,h(be(k,r));case 19:if(null==(R=e.sent)||!R.isStorage()){e.next=23;break}return w.push(k),e.abrupt("break",26);case 23:k=y(k),e.next=16;break;case 26:return e.abrupt("return",Qe({webId:t,storageUrls:w,cloaked:j,writableProfileUrl:v},l({name:null!==(n=null===(o=m.statement(t,"vcard:fn"))||void 0===o?void 0:o.object.value)&&void 0!==n?n:null===(u=m.statement(t,"foaf:name"))||void 0===u?void 0:u.object.value,avatarUrl:null!==(s=null===(a=m.statement(t,"vcard:hasPhoto"))||void 0===a?void 0:a.object.value)&&void 0!==s?s:null===(c=m.statement(t,"foaf:img"))||void 0===c?void 0:c.object.value,oidcIssuerUrl:null===(i=m.statement(t,"solid:oidcIssuer"))||void 0===i?void 0:i.object.value,publicTypeIndexUrl:null==x?void 0:x.object.value,privateTypeIndexUrl:null==g?void 0:g.object.value})));case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(e,t){return Je.apply(this,arguments)}function Je(){return(Je=U(O.mark((function e(t,r){var n,o,u;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=h((function(e){return He(e,r)})),e.next=3,u(t);case 3:if(e.t2=o=e.sent,e.t1=null!==e.t2,!e.t1){e.next=7;break}e.t1=void 0!==o;case 7:if(!e.t1){e.next=11;break}e.t3=o,e.next=14;break;case 11:return e.next=13,u(t.replace(/\/$/,"").concat("/profile/card#me"));case 13:e.t3=e.sent;case 14:if(e.t4=n=e.t3,e.t0=null!==e.t4,!e.t0){e.next=18;break}e.t0=void 0!==n;case 18:if(!e.t0){e.next=22;break}e.t5=n,e.next=25;break;case 22:return e.next=24,u(v(t).concat("/profile/card#me"));case 24:e.t5=e.sent;case 25:return e.abrupt("return",e.t5);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e){var t=function(e){return e.path&&e.path.startsWith("/")?e.path.match(/^\/[^/]*$/)?"/":"/".concat(p(e.path.split("/")).filter().slice(0,-1).join("/"),"/").replace("//","/"):null}(e);return e.protocol&&e.domain?"".concat(e.protocol,"://").concat(e.domain).concat(null!=t?t:"/"):t}function Xe(e){var t;if("@type"in e&&!("@value"in e)){e["@id"]=null!==(t=e["@id"])&&void 0!==t?t:x();for(var r=0,n=Object.values(e);r<n.length;r++){var o=n[r];g(o)&&Xe(o),k(o)&&o.forEach((function(e){return g(e)&&Xe(e)}))}}}function Ke(e){return d(j(e),(function(e){return Xe(e)}))}function Ve(e){var t=w(e);return t?l({containerUrl:Ge(t),documentName:t.path?t.path.split("/").pop():null,resourceHash:t.fragment}):{}}function Ye(e,t,r){return Ze.apply(this,arguments)}function Ze(){return(Ze=U(O.mark((function e(t,r,n){var o,u,s;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(o=n)&&void 0!==o?o:window.fetch.bind(n),u=t.storageUrls[0],s="".concat(u,"settings/").concat(r,"TypeIndex"),e.next=5,Ue(s,n);case 5:if(!e.sent){e.next=9;break}e.t0="".concat(u,"settings/").concat(r,"TypeIndex-").concat(x()),e.next=10;break;case 9:e.t0=s;case 10:return e.abrupt("return",e.t0);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function et(e,t,r){return tt.apply(this,arguments)}function tt(){return(tt=U(O.mark((function e(t,r,n){var o,u,s,a;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.writableProfileUrl){e.next=2;break}throw new Error("Can't create type index without a writable profile document");case 2:return n=null!==(o=n)&&void 0!==o?o:window.fetch.bind(n),e.next=5,Ye(t,r,n);case 5:return u=e.sent,s="public"===r?"<> a <http://www.w3.org/ns/solid/terms#TypeIndex> .":"\n <> a\n <http://www.w3.org/ns/solid/terms#TypeIndex>,\n <http://www.w3.org/ns/solid/terms#UnlistedDocument> .\n ",a="\n INSERT DATA {\n <".concat(t.webId,"> <http://www.w3.org/ns/solid/terms#").concat(r,"TypeIndex> <").concat(u,"> .\n }\n "),e.next=10,Promise.all([he(u,s,n),ze(t.writableProfileUrl,a,n)]);case 10:return e.abrupt("return",u);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rt(e,t,r,n){return nt.apply(this,arguments)}function nt(){return(nt=U(O.mark((function e(t,r,n,o){var u,s;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,be(t,o);case 2:return u=e.sent,s=Array.isArray(r)?r:[r],e.abrupt("return",s.map((function(e){return u.statements(void 0,"rdf:type","solid:TypeRegistration").filter((function(t){return u.contains(t.subject.value,"solid:forClass",e)})).map((function(e){return u.statements(e.subject.value,n)})).flat().map((function(e){return e.object.value})).filter((function(e){return!!e}))})).flat());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ot(e,t){return ut.apply(this,arguments)}function ut(){return(ut=U(O.mark((function e(t,r){return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",et(t,"public",r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function st(e,t){return at.apply(this,arguments)}function at(){return(at=U(O.mark((function e(t,r){return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",et(t,"private",r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ct(e,t,r){return it.apply(this,arguments)}function it(){return(it=U(O.mark((function e(t,r,n){return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rt(t,r,"solid:instanceContainer",n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lt(e,t,r){return ft.apply(this,arguments)}function ft(){return(ft=U(O.mark((function e(t,r,n){return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rt(t,r,"solid:instance",n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dt(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 u,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,u=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw u}}}}function dt(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}function mt(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,u=o(e);if(t){var s=o(this).constructor;r=Reflect.construct(u,arguments,s)}else r=u.apply(this,arguments);return n(this,r)}}var vt={},ht={"%uuid%":"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},yt=function(n){r(ExpectedQuadAssertionError,s);var o=mt(ExpectedQuadAssertionError);function ExpectedQuadAssertionError(r){var n;return e(this,ExpectedQuadAssertionError),n=o.call(this,"Couldn't find the following triple: ".concat(Te(r))),u(t(n),"expectedQuad",void 0),n.expectedQuad=r,n}return ExpectedQuadAssertionError}();function bt(e,t){var r,n=pt(e);try{var o=function(){var e=r.value,n=t.find((function(t){return n=t,function(e,t){if(e.termType!==t.termType)return!1;if("Literal"===e.termType&&"Literal"===t.termType){if(e.datatype.value!==t.datatype.value)return!1;if(!jt(e.value))return"http://www.w3.org/2001/XMLSchema#dateTime"===e.datatype.value?new Date(e.value).getTime()===new Date(t.value).getTime():e.value===t.value}return wt(e.value,t.value)}((r=e).object,n.object)&&wt(r.subject.value,n.subject.value)&&wt(r.predicate.value,n.predicate.value);var r,n}));if(!n)throw new yt(e);E(t,n)};for(n.s();!(r=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}}function jt(e){return/\[\[(.*\]\[)?([^\]]+)\]\]/.test(e)}function wt(e,t){var r,n;return jt(e)?(null!==(n=(r=vt)[e])&&void 0!==n?n:r[e]=function(e){var t,r=[],n=[],o=e,u=pt(f(e,/\[\[((.*?)\]\[)?([^\]]+)\]\]/g));try{for(u.s();!(t=u.n()).done;){var s=t.value;s[2]&&r.push(s[2]),n.push(s[3]),o=o.replace(s[0],"%PATTERN".concat(n.length-1,"%"))}}catch(e){u.e(e)}finally{u.f()}o=o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");for(var a=0,c=Object.entries(n);a<c.length;a++){var i,l=T(c[a],2),p=l[0],d=l[1];o=o.replace("%PATTERN".concat(p,"%"),null!==(i=ht[d])&&void 0!==i?i:d)}return new RegExp(o)}(e)).test(t):e===t}function xt(){vt={}}function gt(e,t){return kt.apply(this,arguments)}function kt(){return(kt=U(O.mark((function e(t,r){var n,o,u,s,a;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return xt(),e.next=3,ge(t);case 3:return n=e.sent,e.next=6,ge(r);case 6:if(o=e.sent,u=Ae(n),s=Ae(o),a=function(e,t){return{success:e,message:t,expected:u,actual:s}},n.length===o.length){e.next=12;break}return e.abrupt("return",a(!1,"Expected ".concat(n.length," triples, found ").concat(o.length,".")));case 12:e.prev=12,bt(n,o),e.next=21;break;case 16:if(e.prev=16,e.t0=e.catch(12),e.t0 instanceof yt){e.next=20;break}throw e.t0;case 20:return e.abrupt("return",a(!1,e.t0.message));case 21:return e.abrupt("return",a(!0,"jsonld matches"));case 22:case"end":return e.stop()}}),e,null,[[12,16]])})))).apply(this,arguments)}function Rt(e,t){var r;xt();for(var n=Se(e,{normalizeBlankNodes:!0}),o=Se(t,{normalizeBlankNodes:!0}),u=function(r,n){return{success:r,message:n,expected:e,actual:t}},s=0,a=Object.keys(n);s<a.length;s++){var c=a[s];if(!(c in o))return u(!1,"Couldn't find expected ".concat(c," operation."));var i=R(n,c),l=R(o,c);if(i.length!==l.length)return u(!1,"Expected ".concat(i.length," ").concat(c," triples, found ").concat(l.length,"."));try{bt(i,l)}catch(e){if(!(e instanceof yt))throw e;return u(!1,"Couldn't find the following ".concat(c," triple: ").concat(Te(e.expectedQuad)))}}var f=null!==(r=Object.keys(o)[0])&&void 0!==r?r:null;return f?u(!1,"Did not expect to find ".concat(f," triples.")):u(!0,"sparql matches")}function Et(e,t){xt();var r=Ne(e,{normalizeBlankNodes:!0}),n=Ne(t,{normalizeBlankNodes:!0}),o=function(r,n){return{success:r,message:n,expected:e,actual:t}};if(r.length!==n.length)return o(!1,"Expected ".concat(r.length," triples, found ").concat(n.length,"."));try{bt(r,n)}catch(e){if(!(e instanceof yt))throw e;return o(!1,e.message)}return o(!0,"turtle matches")}function It(e,t){return Pt.apply(this,arguments)}function Pt(){return(Pt=U(O.mark((function e(t,r){var n,o,u,s,a,c,i;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null!==(n=r)&&void 0!==n?n:window.fetch.bind(window),e.next=3,r(t,{method:"HEAD"});case 3:if(a=e.sent,c=null!==(o=a.headers.get("Link"))&&void 0!==o?o:"",i=null!==(u=null===(s=c.match(/<([^>]+)>;\s*rel="acl"/))||void 0===s?void 0:s[1])&&void 0!==u?u:null){e.next=8;break}throw new Error("Could not find ACL Resource for '".concat(t,"'"));case 8:return e.abrupt("return",I(P(t),i));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(e,t,r){return Tt.apply(this,arguments)}function Tt(){return(Tt=U(O.mark((function e(t,r,n){var o,u,s;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(o=n)||void 0===o){e.next=4;break}e.t0=o,e.next=7;break;case 4:return e.next=6,It(t,r);case 6:e.t0=e.sent;case 7:return n=e.t0,e.next=10,we(null!==(u=n)&&void 0!==u?u:"",r);case 10:if(s=e.sent){e.next=13;break}return e.abrupt("return",At(P(t),r));case 13:if(!s.isACPResource()){e.next=15;break}throw new Z(t,"ACP");case 15:return e.abrupt("return",s);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ut(e,t){return Ot.apply(this,arguments)}function Ot(){return(Ot=U(O.mark((function e(t,r){var n,o;return O.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,It(t,r);case 2:return n=e.sent,e.next=5,At(t,r,n);case 5:return o=e.sent,e.abrupt("return",l({url:n,effectiveUrl:o.url,document:o}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qt={turtle:function(e){var t=this._obj,r=this.assert.bind(this),n=Et(e,t);r(n.success,n.message,"",n.expected,n.actual)},sparql:function(e){var t=this._obj,r=this.assert.bind(this),n=Rt(e,t);r(n.success,n.message,"",n.expected,n.actual)}};function Ct(){chai.use((function(e){return Object.entries(qt).forEach((function(t){var r=T(t,2),n=r[0],o=r[1];return e.Assertion.addMethod(n,o)}))}))}function St(e,t){var r=e.success,n=t.context.utils;return{pass:r,message:r?function(){return[e.message,n.matcherHint(t.hint)].join("\n\n")}:function(){return[e.message,n.matcherHint(t.hint),["Expected: not ".concat(n.printExpected(t.expected)),"Received: ".concat(n.printReceived(t.received))].join("\n")].join("\n\n")}}}var Dt={toEqualJsonLD:function(e,t){var r=this;return U(O.mark((function n(){var o;return O.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,gt(t,e);case 2:return o=n.sent,n.abrupt("return",St(o,{context:r,hint:"toEqualJsonLD",expected:t,received:e}));case 4:case"end":return n.stop()}}),n)})))()},toEqualSparql:function(e,t){return St(Rt(t,e),{context:this,hint:"toEqualSparql",expected:Re(t),received:Re(e)})}};function Bt(){expect.extend(Dt)}export{F as MalformedSolidDocumentError,$ as NetworkRequestError,J as NotFoundError,ae as SolidDocument,W as SolidDocumentFormat,ne as SolidDocumentPermission,ue as SolidStore,oe as SolidThing,X as UnauthorizedError,V as UnsuccessfulNetworkRequestError,Z as UnsupportedAuthorizationProtocolError,ce as compactJsonLDGraph,st as createPrivateTypeIndex,ot as createPublicTypeIndex,he as createSolidDocument,te as defineIRIPrefix,re as expandIRI,_e as fetchLoginUserProfile,be as fetchSolidDocument,Ut as fetchSolidDocumentACL,we as fetchSolidDocumentIfFound,ct as findContainerRegistrations,lt as findInstanceRegistrations,Ct as installChaiPlugin,Bt as installJestPlugin,le as isJsonLDGraph,gt as jsonldEquals,ge as jsonldToQuads,Ke as mintJsonLDIdentifiers,Re as normalizeSparql,Ve as parseResourceSubject,Ee as parseTurtle,Te as quadToTurtle,Ie as quadsToJsonLD,Ae as quadsToTurtle,Ue as solidDocumentExists,Rt as sparqlEquals,qe as sparqlToQuads,Se as sparqlToQuadsSync,Et as turtleEquals,De as turtleToQuads,Ne as turtleToQuadsSync,ze as updateSolidDocument};
2
2
  //# sourceMappingURL=noeldemartin-solid-utils.esm.js.map