@fedify/fedify 0.8.0-dev.164 → 0.8.0-dev.167

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.

Potentially problematic release.


This version of @fedify/fedify might be problematic. Click here for more details.

@@ -11,10 +11,14 @@ import { LanguageString } from "../runtime/langstr.js";
11
11
  */
12
12
  export class PropertyValue {
13
13
  #documentLoader;
14
+ #contextLoader;
14
15
  id;
15
16
  get _documentLoader() {
16
17
  return this.#documentLoader;
17
18
  }
19
+ get _contextLoader() {
20
+ return this.#contextLoader;
21
+ }
18
22
  /**
19
23
  * The type URI of {@link PropertyValue}: `http://schema.org#PropertyValue`.
20
24
  */
@@ -28,8 +32,9 @@ export class PropertyValue {
28
32
  * @param values The values to initialize the instance with.
29
33
  * @param options The options to use for initialization.
30
34
  */
31
- constructor(values, { documentLoader } = {}) {
35
+ constructor(values, { documentLoader, contextLoader, } = {}) {
32
36
  this.#documentLoader = documentLoader;
37
+ this.#contextLoader = contextLoader;
33
38
  this.id = values.id ?? null;
34
39
  if ("name" in values && values.name != null) {
35
40
  this.#_4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [values.name];
@@ -78,7 +83,7 @@ export class PropertyValue {
78
83
  async toJsonLd(options = {}) {
79
84
  options = {
80
85
  ...options,
81
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
86
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
82
87
  };
83
88
  // deno-lint-ignore no-unused-vars prefer-const
84
89
  let array;
@@ -106,13 +111,13 @@ export class PropertyValue {
106
111
  if (this.id)
107
112
  values["@id"] = this.id.href;
108
113
  if (options.expand) {
109
- return await jsonld.expand(values, options);
114
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
110
115
  }
111
116
  return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
112
117
  "schema": "http://schema.org#",
113
118
  "PropertyValue": "schema:PropertyValue",
114
119
  "value": "schema:value",
115
- }], options);
120
+ }], { documentLoader: options.contextLoader });
116
121
  }
117
122
  /**
118
123
  * Converts a JSON-LD structure to an object of this type.
@@ -129,6 +134,7 @@ export class PropertyValue {
129
134
  options = {
130
135
  ...options,
131
136
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
137
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
132
138
  };
133
139
  // deno-lint-ignore no-explicit-any
134
140
  let values;
@@ -137,7 +143,7 @@ export class PropertyValue {
137
143
  }
138
144
  else {
139
145
  const expanded = await jsonld.expand(json, {
140
- ...options,
146
+ documentLoader: options.contextLoader,
141
147
  keepFreeFloatingNodes: true,
142
148
  });
143
149
  values =
@@ -149,7 +155,7 @@ export class PropertyValue {
149
155
  throw new TypeError("Invalid type: " + values["@type"]);
150
156
  }
151
157
  }
152
- const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, { documentLoader: options?.documentLoader });
158
+ const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
153
159
  const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav = [];
154
160
  for (const v of values["https://www.w3.org/ns/activitystreams#name"] ?? []) {
155
161
  if (v == null)
@@ -231,10 +237,14 @@ export class PropertyValue {
231
237
  */
232
238
  export class CryptographicKey {
233
239
  #documentLoader;
240
+ #contextLoader;
234
241
  id;
235
242
  get _documentLoader() {
236
243
  return this.#documentLoader;
237
244
  }
245
+ get _contextLoader() {
246
+ return this.#contextLoader;
247
+ }
238
248
  /**
239
249
  * The type URI of {@link CryptographicKey}: `https://w3id.org/security#Key`.
240
250
  */
@@ -248,8 +258,9 @@ export class CryptographicKey {
248
258
  * @param values The values to initialize the instance with.
249
259
  * @param options The options to use for initialization.
250
260
  */
251
- constructor(values, { documentLoader } = {}) {
261
+ constructor(values, { documentLoader, contextLoader, } = {}) {
252
262
  this.#documentLoader = documentLoader;
263
+ this.#contextLoader = contextLoader;
253
264
  this.id = values.id ?? null;
254
265
  if ("owner" in values && values.owner != null) {
255
266
  this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [values.owner];
@@ -280,37 +291,39 @@ export class CryptographicKey {
280
291
  async #fetchOwner(url, options = {}) {
281
292
  const documentLoader = options.documentLoader ?? this._documentLoader ??
282
293
  fetchDocumentLoader;
294
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
295
+ fetchDocumentLoader;
283
296
  const { document } = await documentLoader(url.href);
284
297
  try {
285
- return await Application.fromJsonLd(document, { documentLoader });
298
+ return await Application.fromJsonLd(document, { documentLoader, contextLoader });
286
299
  }
287
300
  catch (e) {
288
301
  if (!(e instanceof TypeError))
289
302
  throw e;
290
303
  }
291
304
  try {
292
- return await Group.fromJsonLd(document, { documentLoader });
305
+ return await Group.fromJsonLd(document, { documentLoader, contextLoader });
293
306
  }
294
307
  catch (e) {
295
308
  if (!(e instanceof TypeError))
296
309
  throw e;
297
310
  }
298
311
  try {
299
- return await Organization.fromJsonLd(document, { documentLoader });
312
+ return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
300
313
  }
301
314
  catch (e) {
302
315
  if (!(e instanceof TypeError))
303
316
  throw e;
304
317
  }
305
318
  try {
306
- return await Person.fromJsonLd(document, { documentLoader });
319
+ return await Person.fromJsonLd(document, { documentLoader, contextLoader });
307
320
  }
308
321
  catch (e) {
309
322
  if (!(e instanceof TypeError))
310
323
  throw e;
311
324
  }
312
325
  try {
313
- return await Service.fromJsonLd(document, { documentLoader });
326
+ return await Service.fromJsonLd(document, { documentLoader, contextLoader });
314
327
  }
315
328
  catch (e) {
316
329
  if (!(e instanceof TypeError))
@@ -365,7 +378,7 @@ export class CryptographicKey {
365
378
  async toJsonLd(options = {}) {
366
379
  options = {
367
380
  ...options,
368
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
381
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
369
382
  };
370
383
  // deno-lint-ignore no-unused-vars prefer-const
371
384
  let array;
@@ -397,9 +410,9 @@ export class CryptographicKey {
397
410
  if (this.id)
398
411
  values["@id"] = this.id.href;
399
412
  if (options.expand) {
400
- return await jsonld.expand(values, options);
413
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
401
414
  }
402
- return await jsonld.compact(values, "https://w3id.org/security/v1", options);
415
+ return await jsonld.compact(values, "https://w3id.org/security/v1", { documentLoader: options.contextLoader });
403
416
  }
404
417
  /**
405
418
  * Converts a JSON-LD structure to an object of this type.
@@ -416,6 +429,7 @@ export class CryptographicKey {
416
429
  options = {
417
430
  ...options,
418
431
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
432
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
419
433
  };
420
434
  // deno-lint-ignore no-explicit-any
421
435
  let values;
@@ -424,7 +438,7 @@ export class CryptographicKey {
424
438
  }
425
439
  else {
426
440
  const expanded = await jsonld.expand(json, {
427
- ...options,
441
+ documentLoader: options.contextLoader,
428
442
  keepFreeFloatingNodes: true,
429
443
  });
430
444
  values =
@@ -436,7 +450,7 @@ export class CryptographicKey {
436
450
  throw new TypeError("Invalid type: " + values["@type"]);
437
451
  }
438
452
  }
439
- const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, { documentLoader: options?.documentLoader });
453
+ const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
440
454
  const _5UJq9NDh3ZHgswFwwdVxQvJxdx2 = [];
441
455
  for (const v of values["https://w3id.org/security#owner"] ?? []) {
442
456
  if (v == null)
@@ -530,10 +544,14 @@ export class CryptographicKey {
530
544
  */
531
545
  export class Object {
532
546
  #documentLoader;
547
+ #contextLoader;
533
548
  id;
534
549
  get _documentLoader() {
535
550
  return this.#documentLoader;
536
551
  }
552
+ get _contextLoader() {
553
+ return this.#contextLoader;
554
+ }
537
555
  /**
538
556
  * The type URI of {@link Object}: `https://www.w3.org/ns/activitystreams#Object`.
539
557
  */
@@ -572,8 +590,9 @@ export class Object {
572
590
  * @param values The values to initialize the instance with.
573
591
  * @param options The options to use for initialization.
574
592
  */
575
- constructor(values, { documentLoader } = {}) {
593
+ constructor(values, { documentLoader, contextLoader, } = {}) {
576
594
  this.#documentLoader = documentLoader;
595
+ this.#contextLoader = contextLoader;
577
596
  this.id = values.id ?? null;
578
597
  if ("attachments" in values && values.attachments != null) {
579
598
  this.#_49BipA5dq9eoH8LX8xdsVumveTca = values.attachments;
@@ -1019,23 +1038,25 @@ export class Object {
1019
1038
  async #fetchAttachment(url, options = {}) {
1020
1039
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1021
1040
  fetchDocumentLoader;
1041
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1042
+ fetchDocumentLoader;
1022
1043
  const { document } = await documentLoader(url.href);
1023
1044
  try {
1024
- return await _a.fromJsonLd(document, { documentLoader });
1045
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1025
1046
  }
1026
1047
  catch (e) {
1027
1048
  if (!(e instanceof TypeError))
1028
1049
  throw e;
1029
1050
  }
1030
1051
  try {
1031
- return await Link.fromJsonLd(document, { documentLoader });
1052
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1032
1053
  }
1033
1054
  catch (e) {
1034
1055
  if (!(e instanceof TypeError))
1035
1056
  throw e;
1036
1057
  }
1037
1058
  try {
1038
- return await PropertyValue.fromJsonLd(document, { documentLoader });
1059
+ return await PropertyValue.fromJsonLd(document, { documentLoader, contextLoader });
1039
1060
  }
1040
1061
  catch (e) {
1041
1062
  if (!(e instanceof TypeError))
@@ -1076,37 +1097,39 @@ export class Object {
1076
1097
  async #fetchAttribution(url, options = {}) {
1077
1098
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1078
1099
  fetchDocumentLoader;
1100
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1101
+ fetchDocumentLoader;
1079
1102
  const { document } = await documentLoader(url.href);
1080
1103
  try {
1081
- return await Application.fromJsonLd(document, { documentLoader });
1104
+ return await Application.fromJsonLd(document, { documentLoader, contextLoader });
1082
1105
  }
1083
1106
  catch (e) {
1084
1107
  if (!(e instanceof TypeError))
1085
1108
  throw e;
1086
1109
  }
1087
1110
  try {
1088
- return await Group.fromJsonLd(document, { documentLoader });
1111
+ return await Group.fromJsonLd(document, { documentLoader, contextLoader });
1089
1112
  }
1090
1113
  catch (e) {
1091
1114
  if (!(e instanceof TypeError))
1092
1115
  throw e;
1093
1116
  }
1094
1117
  try {
1095
- return await Organization.fromJsonLd(document, { documentLoader });
1118
+ return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
1096
1119
  }
1097
1120
  catch (e) {
1098
1121
  if (!(e instanceof TypeError))
1099
1122
  throw e;
1100
1123
  }
1101
1124
  try {
1102
- return await Person.fromJsonLd(document, { documentLoader });
1125
+ return await Person.fromJsonLd(document, { documentLoader, contextLoader });
1103
1126
  }
1104
1127
  catch (e) {
1105
1128
  if (!(e instanceof TypeError))
1106
1129
  throw e;
1107
1130
  }
1108
1131
  try {
1109
- return await Service.fromJsonLd(document, { documentLoader });
1132
+ return await Service.fromJsonLd(document, { documentLoader, contextLoader });
1110
1133
  }
1111
1134
  catch (e) {
1112
1135
  if (!(e instanceof TypeError))
@@ -1177,9 +1200,11 @@ export class Object {
1177
1200
  async #fetchAudience(url, options = {}) {
1178
1201
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1179
1202
  fetchDocumentLoader;
1203
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1204
+ fetchDocumentLoader;
1180
1205
  const { document } = await documentLoader(url.href);
1181
1206
  try {
1182
- return await _a.fromJsonLd(document, { documentLoader });
1207
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1183
1208
  }
1184
1209
  catch (e) {
1185
1210
  if (!(e instanceof TypeError))
@@ -1262,16 +1287,18 @@ export class Object {
1262
1287
  async #fetchContext(url, options = {}) {
1263
1288
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1264
1289
  fetchDocumentLoader;
1290
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1291
+ fetchDocumentLoader;
1265
1292
  const { document } = await documentLoader(url.href);
1266
1293
  try {
1267
- return await _a.fromJsonLd(document, { documentLoader });
1294
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1268
1295
  }
1269
1296
  catch (e) {
1270
1297
  if (!(e instanceof TypeError))
1271
1298
  throw e;
1272
1299
  }
1273
1300
  try {
1274
- return await Link.fromJsonLd(document, { documentLoader });
1301
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1275
1302
  }
1276
1303
  catch (e) {
1277
1304
  if (!(e instanceof TypeError))
@@ -1341,16 +1368,18 @@ export class Object {
1341
1368
  async #fetchGenerator(url, options = {}) {
1342
1369
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1343
1370
  fetchDocumentLoader;
1371
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1372
+ fetchDocumentLoader;
1344
1373
  const { document } = await documentLoader(url.href);
1345
1374
  try {
1346
- return await _a.fromJsonLd(document, { documentLoader });
1375
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1347
1376
  }
1348
1377
  catch (e) {
1349
1378
  if (!(e instanceof TypeError))
1350
1379
  throw e;
1351
1380
  }
1352
1381
  try {
1353
- return await Link.fromJsonLd(document, { documentLoader });
1382
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1354
1383
  }
1355
1384
  catch (e) {
1356
1385
  if (!(e instanceof TypeError))
@@ -1388,9 +1417,11 @@ export class Object {
1388
1417
  async #fetchIcon(url, options = {}) {
1389
1418
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1390
1419
  fetchDocumentLoader;
1420
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1421
+ fetchDocumentLoader;
1391
1422
  const { document } = await documentLoader(url.href);
1392
1423
  try {
1393
- return await Image.fromJsonLd(document, { documentLoader });
1424
+ return await Image.fromJsonLd(document, { documentLoader, contextLoader });
1394
1425
  }
1395
1426
  catch (e) {
1396
1427
  if (!(e instanceof TypeError))
@@ -1455,9 +1486,11 @@ export class Object {
1455
1486
  async #fetchImage(url, options = {}) {
1456
1487
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1457
1488
  fetchDocumentLoader;
1489
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1490
+ fetchDocumentLoader;
1458
1491
  const { document } = await documentLoader(url.href);
1459
1492
  try {
1460
- return await Image.fromJsonLd(document, { documentLoader });
1493
+ return await Image.fromJsonLd(document, { documentLoader, contextLoader });
1461
1494
  }
1462
1495
  catch (e) {
1463
1496
  if (!(e instanceof TypeError))
@@ -1522,16 +1555,18 @@ export class Object {
1522
1555
  async #fetchReplyTarget(url, options = {}) {
1523
1556
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1524
1557
  fetchDocumentLoader;
1558
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1559
+ fetchDocumentLoader;
1525
1560
  const { document } = await documentLoader(url.href);
1526
1561
  try {
1527
- return await _a.fromJsonLd(document, { documentLoader });
1562
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1528
1563
  }
1529
1564
  catch (e) {
1530
1565
  if (!(e instanceof TypeError))
1531
1566
  throw e;
1532
1567
  }
1533
1568
  try {
1534
- return await Link.fromJsonLd(document, { documentLoader });
1569
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1535
1570
  }
1536
1571
  catch (e) {
1537
1572
  if (!(e instanceof TypeError))
@@ -1597,16 +1632,18 @@ export class Object {
1597
1632
  async #fetchLocation(url, options = {}) {
1598
1633
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1599
1634
  fetchDocumentLoader;
1635
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1636
+ fetchDocumentLoader;
1600
1637
  const { document } = await documentLoader(url.href);
1601
1638
  try {
1602
- return await _a.fromJsonLd(document, { documentLoader });
1639
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1603
1640
  }
1604
1641
  catch (e) {
1605
1642
  if (!(e instanceof TypeError))
1606
1643
  throw e;
1607
1644
  }
1608
1645
  try {
1609
- return await Link.fromJsonLd(document, { documentLoader });
1646
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1610
1647
  }
1611
1648
  catch (e) {
1612
1649
  if (!(e instanceof TypeError))
@@ -1672,16 +1709,18 @@ export class Object {
1672
1709
  async #fetchPreview(url, options = {}) {
1673
1710
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1674
1711
  fetchDocumentLoader;
1712
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1713
+ fetchDocumentLoader;
1675
1714
  const { document } = await documentLoader(url.href);
1676
1715
  try {
1677
- return await Link.fromJsonLd(document, { documentLoader });
1716
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1678
1717
  }
1679
1718
  catch (e) {
1680
1719
  if (!(e instanceof TypeError))
1681
1720
  throw e;
1682
1721
  }
1683
1722
  try {
1684
- return await _a.fromJsonLd(document, { documentLoader });
1723
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1685
1724
  }
1686
1725
  catch (e) {
1687
1726
  if (!(e instanceof TypeError))
@@ -1752,9 +1791,11 @@ export class Object {
1752
1791
  async #fetchReplies(url, options = {}) {
1753
1792
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1754
1793
  fetchDocumentLoader;
1794
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1795
+ fetchDocumentLoader;
1755
1796
  const { document } = await documentLoader(url.href);
1756
1797
  try {
1757
- return await Collection.fromJsonLd(document, { documentLoader });
1798
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
1758
1799
  }
1759
1800
  catch (e) {
1760
1801
  if (!(e instanceof TypeError))
@@ -1817,16 +1858,18 @@ export class Object {
1817
1858
  async #fetchTag(url, options = {}) {
1818
1859
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1819
1860
  fetchDocumentLoader;
1861
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1862
+ fetchDocumentLoader;
1820
1863
  const { document } = await documentLoader(url.href);
1821
1864
  try {
1822
- return await _a.fromJsonLd(document, { documentLoader });
1865
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1823
1866
  }
1824
1867
  catch (e) {
1825
1868
  if (!(e instanceof TypeError))
1826
1869
  throw e;
1827
1870
  }
1828
1871
  try {
1829
- return await Link.fromJsonLd(document, { documentLoader });
1872
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
1830
1873
  }
1831
1874
  catch (e) {
1832
1875
  if (!(e instanceof TypeError))
@@ -1886,9 +1929,11 @@ export class Object {
1886
1929
  async #fetchTo(url, options = {}) {
1887
1930
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1888
1931
  fetchDocumentLoader;
1932
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
1933
+ fetchDocumentLoader;
1889
1934
  const { document } = await documentLoader(url.href);
1890
1935
  try {
1891
- return await _a.fromJsonLd(document, { documentLoader });
1936
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1892
1937
  }
1893
1938
  catch (e) {
1894
1939
  if (!(e instanceof TypeError))
@@ -1951,9 +1996,11 @@ export class Object {
1951
1996
  async #fetchBto(url, options = {}) {
1952
1997
  const documentLoader = options.documentLoader ?? this._documentLoader ??
1953
1998
  fetchDocumentLoader;
1999
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
2000
+ fetchDocumentLoader;
1954
2001
  const { document } = await documentLoader(url.href);
1955
2002
  try {
1956
- return await _a.fromJsonLd(document, { documentLoader });
2003
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
1957
2004
  }
1958
2005
  catch (e) {
1959
2006
  if (!(e instanceof TypeError))
@@ -2016,9 +2063,11 @@ export class Object {
2016
2063
  async #fetchCc(url, options = {}) {
2017
2064
  const documentLoader = options.documentLoader ?? this._documentLoader ??
2018
2065
  fetchDocumentLoader;
2066
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
2067
+ fetchDocumentLoader;
2019
2068
  const { document } = await documentLoader(url.href);
2020
2069
  try {
2021
- return await _a.fromJsonLd(document, { documentLoader });
2070
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
2022
2071
  }
2023
2072
  catch (e) {
2024
2073
  if (!(e instanceof TypeError))
@@ -2081,9 +2130,11 @@ export class Object {
2081
2130
  async #fetchBcc(url, options = {}) {
2082
2131
  const documentLoader = options.documentLoader ?? this._documentLoader ??
2083
2132
  fetchDocumentLoader;
2133
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
2134
+ fetchDocumentLoader;
2084
2135
  const { document } = await documentLoader(url.href);
2085
2136
  try {
2086
- return await _a.fromJsonLd(document, { documentLoader });
2137
+ return await _a.fromJsonLd(document, { documentLoader, contextLoader });
2087
2138
  }
2088
2139
  catch (e) {
2089
2140
  if (!(e instanceof TypeError))
@@ -2177,7 +2228,7 @@ export class Object {
2177
2228
  async toJsonLd(options = {}) {
2178
2229
  options = {
2179
2230
  ...options,
2180
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
2231
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
2181
2232
  };
2182
2233
  // deno-lint-ignore no-unused-vars prefer-const
2183
2234
  let array;
@@ -2439,11 +2490,11 @@ export class Object {
2439
2490
  if (this.id)
2440
2491
  values["@id"] = this.id.href;
2441
2492
  if (options.expand) {
2442
- return await jsonld.expand(values, options);
2493
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
2443
2494
  }
2444
2495
  return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", {
2445
2496
  "sensitive": "as:sensitive",
2446
- }], options);
2497
+ }], { documentLoader: options.contextLoader });
2447
2498
  }
2448
2499
  /**
2449
2500
  * Converts a JSON-LD structure to an object of this type.
@@ -2460,6 +2511,7 @@ export class Object {
2460
2511
  options = {
2461
2512
  ...options,
2462
2513
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
2514
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
2463
2515
  };
2464
2516
  // deno-lint-ignore no-explicit-any
2465
2517
  let values;
@@ -2468,7 +2520,7 @@ export class Object {
2468
2520
  }
2469
2521
  else {
2470
2522
  const expanded = await jsonld.expand(json, {
2471
- ...options,
2523
+ documentLoader: options.contextLoader,
2472
2524
  keepFreeFloatingNodes: true,
2473
2525
  });
2474
2526
  values =
@@ -2628,7 +2680,7 @@ export class Object {
2628
2680
  throw new TypeError("Invalid type: " + values["@type"]);
2629
2681
  }
2630
2682
  }
2631
- const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, { documentLoader: options?.documentLoader });
2683
+ const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
2632
2684
  const _49BipA5dq9eoH8LX8xdsVumveTca = [];
2633
2685
  for (const v of values["https://www.w3.org/ns/activitystreams#attachment"] ??
2634
2686
  []) {
@@ -3763,8 +3815,8 @@ export class Activity extends Object {
3763
3815
  * @param values The values to initialize the instance with.
3764
3816
  * @param options The options to use for initialization.
3765
3817
  */
3766
- constructor(values, { documentLoader } = {}) {
3767
- super(values, { documentLoader });
3818
+ constructor(values, { documentLoader, contextLoader, } = {}) {
3819
+ super(values, { documentLoader, contextLoader });
3768
3820
  if ("actor" in values && values.actor != null) {
3769
3821
  this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D = [values.actor];
3770
3822
  }
@@ -3825,37 +3877,39 @@ export class Activity extends Object {
3825
3877
  async #fetchActor(url, options = {}) {
3826
3878
  const documentLoader = options.documentLoader ?? this._documentLoader ??
3827
3879
  fetchDocumentLoader;
3880
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
3881
+ fetchDocumentLoader;
3828
3882
  const { document } = await documentLoader(url.href);
3829
3883
  try {
3830
- return await Application.fromJsonLd(document, { documentLoader });
3884
+ return await Application.fromJsonLd(document, { documentLoader, contextLoader });
3831
3885
  }
3832
3886
  catch (e) {
3833
3887
  if (!(e instanceof TypeError))
3834
3888
  throw e;
3835
3889
  }
3836
3890
  try {
3837
- return await Group.fromJsonLd(document, { documentLoader });
3891
+ return await Group.fromJsonLd(document, { documentLoader, contextLoader });
3838
3892
  }
3839
3893
  catch (e) {
3840
3894
  if (!(e instanceof TypeError))
3841
3895
  throw e;
3842
3896
  }
3843
3897
  try {
3844
- return await Organization.fromJsonLd(document, { documentLoader });
3898
+ return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
3845
3899
  }
3846
3900
  catch (e) {
3847
3901
  if (!(e instanceof TypeError))
3848
3902
  throw e;
3849
3903
  }
3850
3904
  try {
3851
- return await Person.fromJsonLd(document, { documentLoader });
3905
+ return await Person.fromJsonLd(document, { documentLoader, contextLoader });
3852
3906
  }
3853
3907
  catch (e) {
3854
3908
  if (!(e instanceof TypeError))
3855
3909
  throw e;
3856
3910
  }
3857
3911
  try {
3858
- return await Service.fromJsonLd(document, { documentLoader });
3912
+ return await Service.fromJsonLd(document, { documentLoader, contextLoader });
3859
3913
  }
3860
3914
  catch (e) {
3861
3915
  if (!(e instanceof TypeError))
@@ -3926,9 +3980,11 @@ export class Activity extends Object {
3926
3980
  async #fetchObject(url, options = {}) {
3927
3981
  const documentLoader = options.documentLoader ?? this._documentLoader ??
3928
3982
  fetchDocumentLoader;
3983
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
3984
+ fetchDocumentLoader;
3929
3985
  const { document } = await documentLoader(url.href);
3930
3986
  try {
3931
- return await Object.fromJsonLd(document, { documentLoader });
3987
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
3932
3988
  }
3933
3989
  catch (e) {
3934
3990
  if (!(e instanceof TypeError))
@@ -3997,7 +4053,7 @@ export class Activity extends Object {
3997
4053
  async toJsonLd(options = {}) {
3998
4054
  options = {
3999
4055
  ...options,
4000
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
4056
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4001
4057
  };
4002
4058
  // deno-lint-ignore no-unused-vars prefer-const
4003
4059
  let array;
@@ -4034,9 +4090,9 @@ export class Activity extends Object {
4034
4090
  if (this.id)
4035
4091
  values["@id"] = this.id.href;
4036
4092
  if (options.expand) {
4037
- return await jsonld.expand(values, options);
4093
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
4038
4094
  }
4039
- return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"], options);
4095
+ return await jsonld.compact(values, ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"], { documentLoader: options.contextLoader });
4040
4096
  }
4041
4097
  /**
4042
4098
  * Converts a JSON-LD structure to an object of this type.
@@ -4053,6 +4109,7 @@ export class Activity extends Object {
4053
4109
  options = {
4054
4110
  ...options,
4055
4111
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
4112
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4056
4113
  };
4057
4114
  // deno-lint-ignore no-explicit-any
4058
4115
  let values;
@@ -4061,7 +4118,7 @@ export class Activity extends Object {
4061
4118
  }
4062
4119
  else {
4063
4120
  const expanded = await jsonld.expand(json, {
4064
- ...options,
4121
+ documentLoader: options.contextLoader,
4065
4122
  keepFreeFloatingNodes: true,
4066
4123
  });
4067
4124
  values =
@@ -4251,8 +4308,8 @@ export class Accept extends Activity {
4251
4308
  * @param values The values to initialize the instance with.
4252
4309
  * @param options The options to use for initialization.
4253
4310
  */
4254
- constructor(values, { documentLoader } = {}) {
4255
- super(values, { documentLoader });
4311
+ constructor(values, { documentLoader, contextLoader, } = {}) {
4312
+ super(values, { documentLoader, contextLoader });
4256
4313
  }
4257
4314
  /**
4258
4315
  * Clones this instance, optionally updating it with the given values.
@@ -4271,7 +4328,7 @@ export class Accept extends Activity {
4271
4328
  async toJsonLd(options = {}) {
4272
4329
  options = {
4273
4330
  ...options,
4274
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
4331
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4275
4332
  };
4276
4333
  // deno-lint-ignore no-unused-vars prefer-const
4277
4334
  let array;
@@ -4284,9 +4341,9 @@ export class Accept extends Activity {
4284
4341
  if (this.id)
4285
4342
  values["@id"] = this.id.href;
4286
4343
  if (options.expand) {
4287
- return await jsonld.expand(values, options);
4344
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
4288
4345
  }
4289
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
4346
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
4290
4347
  }
4291
4348
  /**
4292
4349
  * Converts a JSON-LD structure to an object of this type.
@@ -4303,6 +4360,7 @@ export class Accept extends Activity {
4303
4360
  options = {
4304
4361
  ...options,
4305
4362
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
4363
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4306
4364
  };
4307
4365
  // deno-lint-ignore no-explicit-any
4308
4366
  let values;
@@ -4311,7 +4369,7 @@ export class Accept extends Activity {
4311
4369
  }
4312
4370
  else {
4313
4371
  const expanded = await jsonld.expand(json, {
4314
- ...options,
4372
+ documentLoader: options.contextLoader,
4315
4373
  keepFreeFloatingNodes: true,
4316
4374
  });
4317
4375
  values =
@@ -4359,8 +4417,8 @@ export class Add extends Activity {
4359
4417
  * @param values The values to initialize the instance with.
4360
4418
  * @param options The options to use for initialization.
4361
4419
  */
4362
- constructor(values, { documentLoader } = {}) {
4363
- super(values, { documentLoader });
4420
+ constructor(values, { documentLoader, contextLoader, } = {}) {
4421
+ super(values, { documentLoader, contextLoader });
4364
4422
  }
4365
4423
  /**
4366
4424
  * Clones this instance, optionally updating it with the given values.
@@ -4379,7 +4437,7 @@ export class Add extends Activity {
4379
4437
  async toJsonLd(options = {}) {
4380
4438
  options = {
4381
4439
  ...options,
4382
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
4440
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4383
4441
  };
4384
4442
  // deno-lint-ignore no-unused-vars prefer-const
4385
4443
  let array;
@@ -4392,9 +4450,9 @@ export class Add extends Activity {
4392
4450
  if (this.id)
4393
4451
  values["@id"] = this.id.href;
4394
4452
  if (options.expand) {
4395
- return await jsonld.expand(values, options);
4453
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
4396
4454
  }
4397
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
4455
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
4398
4456
  }
4399
4457
  /**
4400
4458
  * Converts a JSON-LD structure to an object of this type.
@@ -4411,6 +4469,7 @@ export class Add extends Activity {
4411
4469
  options = {
4412
4470
  ...options,
4413
4471
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
4472
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4414
4473
  };
4415
4474
  // deno-lint-ignore no-explicit-any
4416
4475
  let values;
@@ -4419,7 +4478,7 @@ export class Add extends Activity {
4419
4478
  }
4420
4479
  else {
4421
4480
  const expanded = await jsonld.expand(json, {
4422
- ...options,
4481
+ documentLoader: options.contextLoader,
4423
4482
  keepFreeFloatingNodes: true,
4424
4483
  });
4425
4484
  values =
@@ -4466,8 +4525,8 @@ export class Announce extends Activity {
4466
4525
  * @param values The values to initialize the instance with.
4467
4526
  * @param options The options to use for initialization.
4468
4527
  */
4469
- constructor(values, { documentLoader } = {}) {
4470
- super(values, { documentLoader });
4528
+ constructor(values, { documentLoader, contextLoader, } = {}) {
4529
+ super(values, { documentLoader, contextLoader });
4471
4530
  }
4472
4531
  /**
4473
4532
  * Clones this instance, optionally updating it with the given values.
@@ -4486,7 +4545,7 @@ export class Announce extends Activity {
4486
4545
  async toJsonLd(options = {}) {
4487
4546
  options = {
4488
4547
  ...options,
4489
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
4548
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4490
4549
  };
4491
4550
  // deno-lint-ignore no-unused-vars prefer-const
4492
4551
  let array;
@@ -4499,9 +4558,9 @@ export class Announce extends Activity {
4499
4558
  if (this.id)
4500
4559
  values["@id"] = this.id.href;
4501
4560
  if (options.expand) {
4502
- return await jsonld.expand(values, options);
4561
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
4503
4562
  }
4504
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
4563
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
4505
4564
  }
4506
4565
  /**
4507
4566
  * Converts a JSON-LD structure to an object of this type.
@@ -4518,6 +4577,7 @@ export class Announce extends Activity {
4518
4577
  options = {
4519
4578
  ...options,
4520
4579
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
4580
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
4521
4581
  };
4522
4582
  // deno-lint-ignore no-explicit-any
4523
4583
  let values;
@@ -4526,7 +4586,7 @@ export class Announce extends Activity {
4526
4586
  }
4527
4587
  else {
4528
4588
  const expanded = await jsonld.expand(json, {
4529
- ...options,
4589
+ documentLoader: options.contextLoader,
4530
4590
  keepFreeFloatingNodes: true,
4531
4591
  });
4532
4592
  values =
@@ -4585,8 +4645,8 @@ export class Application extends Object {
4585
4645
  * @param values The values to initialize the instance with.
4586
4646
  * @param options The options to use for initialization.
4587
4647
  */
4588
- constructor(values, { documentLoader } = {}) {
4589
- super(values, { documentLoader });
4648
+ constructor(values, { documentLoader, contextLoader, } = {}) {
4649
+ super(values, { documentLoader, contextLoader });
4590
4650
  if ("preferredUsername" in values && values.preferredUsername != null) {
4591
4651
  this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [values.preferredUsername];
4592
4652
  }
@@ -4747,9 +4807,11 @@ export class Application extends Object {
4747
4807
  async #fetchPublicKey(url, options = {}) {
4748
4808
  const documentLoader = options.documentLoader ?? this._documentLoader ??
4749
4809
  fetchDocumentLoader;
4810
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
4811
+ fetchDocumentLoader;
4750
4812
  const { document } = await documentLoader(url.href);
4751
4813
  try {
4752
- return await CryptographicKey.fromJsonLd(document, { documentLoader });
4814
+ return await CryptographicKey.fromJsonLd(document, { documentLoader, contextLoader });
4753
4815
  }
4754
4816
  catch (e) {
4755
4817
  if (!(e instanceof TypeError))
@@ -4822,9 +4884,11 @@ export class Application extends Object {
4822
4884
  async #fetchInbox(url, options = {}) {
4823
4885
  const documentLoader = options.documentLoader ?? this._documentLoader ??
4824
4886
  fetchDocumentLoader;
4887
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
4888
+ fetchDocumentLoader;
4825
4889
  const { document } = await documentLoader(url.href);
4826
4890
  try {
4827
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
4891
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
4828
4892
  }
4829
4893
  catch (e) {
4830
4894
  if (!(e instanceof TypeError))
@@ -4874,9 +4938,11 @@ export class Application extends Object {
4874
4938
  async #fetchOutbox(url, options = {}) {
4875
4939
  const documentLoader = options.documentLoader ?? this._documentLoader ??
4876
4940
  fetchDocumentLoader;
4941
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
4942
+ fetchDocumentLoader;
4877
4943
  const { document } = await documentLoader(url.href);
4878
4944
  try {
4879
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
4945
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
4880
4946
  }
4881
4947
  catch (e) {
4882
4948
  if (!(e instanceof TypeError))
@@ -4923,9 +4989,11 @@ export class Application extends Object {
4923
4989
  async #fetchFollowing(url, options = {}) {
4924
4990
  const documentLoader = options.documentLoader ?? this._documentLoader ??
4925
4991
  fetchDocumentLoader;
4992
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
4993
+ fetchDocumentLoader;
4926
4994
  const { document } = await documentLoader(url.href);
4927
4995
  try {
4928
- return await Collection.fromJsonLd(document, { documentLoader });
4996
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
4929
4997
  }
4930
4998
  catch (e) {
4931
4999
  if (!(e instanceof TypeError))
@@ -4967,9 +5035,11 @@ export class Application extends Object {
4967
5035
  async #fetchFollowers(url, options = {}) {
4968
5036
  const documentLoader = options.documentLoader ?? this._documentLoader ??
4969
5037
  fetchDocumentLoader;
5038
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
5039
+ fetchDocumentLoader;
4970
5040
  const { document } = await documentLoader(url.href);
4971
5041
  try {
4972
- return await Collection.fromJsonLd(document, { documentLoader });
5042
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
4973
5043
  }
4974
5044
  catch (e) {
4975
5045
  if (!(e instanceof TypeError))
@@ -5014,9 +5084,11 @@ export class Application extends Object {
5014
5084
  async #fetchLinked(url, options = {}) {
5015
5085
  const documentLoader = options.documentLoader ?? this._documentLoader ??
5016
5086
  fetchDocumentLoader;
5087
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
5088
+ fetchDocumentLoader;
5017
5089
  const { document } = await documentLoader(url.href);
5018
5090
  try {
5019
- return await Collection.fromJsonLd(document, { documentLoader });
5091
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
5020
5092
  }
5021
5093
  catch (e) {
5022
5094
  if (!(e instanceof TypeError))
@@ -5059,9 +5131,11 @@ export class Application extends Object {
5059
5131
  async #fetchStream(url, options = {}) {
5060
5132
  const documentLoader = options.documentLoader ?? this._documentLoader ??
5061
5133
  fetchDocumentLoader;
5134
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
5135
+ fetchDocumentLoader;
5062
5136
  const { document } = await documentLoader(url.href);
5063
5137
  try {
5064
- return await Collection.fromJsonLd(document, { documentLoader });
5138
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
5065
5139
  }
5066
5140
  catch (e) {
5067
5141
  if (!(e instanceof TypeError))
@@ -5142,7 +5216,7 @@ export class Application extends Object {
5142
5216
  async toJsonLd(options = {}) {
5143
5217
  options = {
5144
5218
  ...options,
5145
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
5219
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5146
5220
  };
5147
5221
  // deno-lint-ignore no-unused-vars prefer-const
5148
5222
  let array;
@@ -5253,7 +5327,7 @@ export class Application extends Object {
5253
5327
  if (this.id)
5254
5328
  values["@id"] = this.id.href;
5255
5329
  if (options.expand) {
5256
- return await jsonld.expand(values, options);
5330
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
5257
5331
  }
5258
5332
  return await jsonld.compact(values, [
5259
5333
  "https://www.w3.org/ns/activitystreams",
@@ -5269,7 +5343,7 @@ export class Application extends Object {
5269
5343
  "PropertyValue": "schema:PropertyValue",
5270
5344
  "value": "schema:value",
5271
5345
  },
5272
- ], options);
5346
+ ], { documentLoader: options.contextLoader });
5273
5347
  }
5274
5348
  /**
5275
5349
  * Converts a JSON-LD structure to an object of this type.
@@ -5286,6 +5360,7 @@ export class Application extends Object {
5286
5360
  options = {
5287
5361
  ...options,
5288
5362
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
5363
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5289
5364
  };
5290
5365
  // deno-lint-ignore no-explicit-any
5291
5366
  let values;
@@ -5294,7 +5369,7 @@ export class Application extends Object {
5294
5369
  }
5295
5370
  else {
5296
5371
  const expanded = await jsonld.expand(json, {
5297
- ...options,
5372
+ documentLoader: options.contextLoader,
5298
5373
  keepFreeFloatingNodes: true,
5299
5374
  });
5300
5375
  values =
@@ -5649,8 +5724,8 @@ export class Article extends Object {
5649
5724
  * @param values The values to initialize the instance with.
5650
5725
  * @param options The options to use for initialization.
5651
5726
  */
5652
- constructor(values, { documentLoader } = {}) {
5653
- super(values, { documentLoader });
5727
+ constructor(values, { documentLoader, contextLoader, } = {}) {
5728
+ super(values, { documentLoader, contextLoader });
5654
5729
  }
5655
5730
  /**
5656
5731
  * Clones this instance, optionally updating it with the given values.
@@ -5669,7 +5744,7 @@ export class Article extends Object {
5669
5744
  async toJsonLd(options = {}) {
5670
5745
  options = {
5671
5746
  ...options,
5672
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
5747
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5673
5748
  };
5674
5749
  // deno-lint-ignore no-unused-vars prefer-const
5675
5750
  let array;
@@ -5682,9 +5757,9 @@ export class Article extends Object {
5682
5757
  if (this.id)
5683
5758
  values["@id"] = this.id.href;
5684
5759
  if (options.expand) {
5685
- return await jsonld.expand(values, options);
5760
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
5686
5761
  }
5687
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
5762
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5688
5763
  }
5689
5764
  /**
5690
5765
  * Converts a JSON-LD structure to an object of this type.
@@ -5701,6 +5776,7 @@ export class Article extends Object {
5701
5776
  options = {
5702
5777
  ...options,
5703
5778
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
5779
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5704
5780
  };
5705
5781
  // deno-lint-ignore no-explicit-any
5706
5782
  let values;
@@ -5709,7 +5785,7 @@ export class Article extends Object {
5709
5785
  }
5710
5786
  else {
5711
5787
  const expanded = await jsonld.expand(json, {
5712
- ...options,
5788
+ documentLoader: options.contextLoader,
5713
5789
  keepFreeFloatingNodes: true,
5714
5790
  });
5715
5791
  values =
@@ -5754,8 +5830,8 @@ export class Document extends Object {
5754
5830
  * @param values The values to initialize the instance with.
5755
5831
  * @param options The options to use for initialization.
5756
5832
  */
5757
- constructor(values, { documentLoader } = {}) {
5758
- super(values, { documentLoader });
5833
+ constructor(values, { documentLoader, contextLoader, } = {}) {
5834
+ super(values, { documentLoader, contextLoader });
5759
5835
  }
5760
5836
  /**
5761
5837
  * Clones this instance, optionally updating it with the given values.
@@ -5774,7 +5850,7 @@ export class Document extends Object {
5774
5850
  async toJsonLd(options = {}) {
5775
5851
  options = {
5776
5852
  ...options,
5777
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
5853
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5778
5854
  };
5779
5855
  // deno-lint-ignore no-unused-vars prefer-const
5780
5856
  let array;
@@ -5787,9 +5863,9 @@ export class Document extends Object {
5787
5863
  if (this.id)
5788
5864
  values["@id"] = this.id.href;
5789
5865
  if (options.expand) {
5790
- return await jsonld.expand(values, options);
5866
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
5791
5867
  }
5792
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
5868
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5793
5869
  }
5794
5870
  /**
5795
5871
  * Converts a JSON-LD structure to an object of this type.
@@ -5806,6 +5882,7 @@ export class Document extends Object {
5806
5882
  options = {
5807
5883
  ...options,
5808
5884
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
5885
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5809
5886
  };
5810
5887
  // deno-lint-ignore no-explicit-any
5811
5888
  let values;
@@ -5814,7 +5891,7 @@ export class Document extends Object {
5814
5891
  }
5815
5892
  else {
5816
5893
  const expanded = await jsonld.expand(json, {
5817
- ...options,
5894
+ documentLoader: options.contextLoader,
5818
5895
  keepFreeFloatingNodes: true,
5819
5896
  });
5820
5897
  values =
@@ -5875,8 +5952,8 @@ export class Audio extends Document {
5875
5952
  * @param values The values to initialize the instance with.
5876
5953
  * @param options The options to use for initialization.
5877
5954
  */
5878
- constructor(values, { documentLoader } = {}) {
5879
- super(values, { documentLoader });
5955
+ constructor(values, { documentLoader, contextLoader, } = {}) {
5956
+ super(values, { documentLoader, contextLoader });
5880
5957
  }
5881
5958
  /**
5882
5959
  * Clones this instance, optionally updating it with the given values.
@@ -5895,7 +5972,7 @@ export class Audio extends Document {
5895
5972
  async toJsonLd(options = {}) {
5896
5973
  options = {
5897
5974
  ...options,
5898
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
5975
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5899
5976
  };
5900
5977
  // deno-lint-ignore no-unused-vars prefer-const
5901
5978
  let array;
@@ -5908,9 +5985,9 @@ export class Audio extends Document {
5908
5985
  if (this.id)
5909
5986
  values["@id"] = this.id.href;
5910
5987
  if (options.expand) {
5911
- return await jsonld.expand(values, options);
5988
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
5912
5989
  }
5913
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
5990
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
5914
5991
  }
5915
5992
  /**
5916
5993
  * Converts a JSON-LD structure to an object of this type.
@@ -5927,6 +6004,7 @@ export class Audio extends Document {
5927
6004
  options = {
5928
6005
  ...options,
5929
6006
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
6007
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
5930
6008
  };
5931
6009
  // deno-lint-ignore no-explicit-any
5932
6010
  let values;
@@ -5935,7 +6013,7 @@ export class Audio extends Document {
5935
6013
  }
5936
6014
  else {
5937
6015
  const expanded = await jsonld.expand(json, {
5938
- ...options,
6016
+ documentLoader: options.contextLoader,
5939
6017
  keepFreeFloatingNodes: true,
5940
6018
  });
5941
6019
  values =
@@ -5981,8 +6059,8 @@ export class Ignore extends Activity {
5981
6059
  * @param values The values to initialize the instance with.
5982
6060
  * @param options The options to use for initialization.
5983
6061
  */
5984
- constructor(values, { documentLoader } = {}) {
5985
- super(values, { documentLoader });
6062
+ constructor(values, { documentLoader, contextLoader, } = {}) {
6063
+ super(values, { documentLoader, contextLoader });
5986
6064
  }
5987
6065
  /**
5988
6066
  * Clones this instance, optionally updating it with the given values.
@@ -6001,7 +6079,7 @@ export class Ignore extends Activity {
6001
6079
  async toJsonLd(options = {}) {
6002
6080
  options = {
6003
6081
  ...options,
6004
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
6082
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
6005
6083
  };
6006
6084
  // deno-lint-ignore no-unused-vars prefer-const
6007
6085
  let array;
@@ -6014,9 +6092,9 @@ export class Ignore extends Activity {
6014
6092
  if (this.id)
6015
6093
  values["@id"] = this.id.href;
6016
6094
  if (options.expand) {
6017
- return await jsonld.expand(values, options);
6095
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
6018
6096
  }
6019
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
6097
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
6020
6098
  }
6021
6099
  /**
6022
6100
  * Converts a JSON-LD structure to an object of this type.
@@ -6033,6 +6111,7 @@ export class Ignore extends Activity {
6033
6111
  options = {
6034
6112
  ...options,
6035
6113
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
6114
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
6036
6115
  };
6037
6116
  // deno-lint-ignore no-explicit-any
6038
6117
  let values;
@@ -6041,7 +6120,7 @@ export class Ignore extends Activity {
6041
6120
  }
6042
6121
  else {
6043
6122
  const expanded = await jsonld.expand(json, {
6044
- ...options,
6123
+ documentLoader: options.contextLoader,
6045
6124
  keepFreeFloatingNodes: true,
6046
6125
  });
6047
6126
  values =
@@ -6093,8 +6172,8 @@ export class Block extends Ignore {
6093
6172
  * @param values The values to initialize the instance with.
6094
6173
  * @param options The options to use for initialization.
6095
6174
  */
6096
- constructor(values, { documentLoader } = {}) {
6097
- super(values, { documentLoader });
6175
+ constructor(values, { documentLoader, contextLoader, } = {}) {
6176
+ super(values, { documentLoader, contextLoader });
6098
6177
  }
6099
6178
  /**
6100
6179
  * Clones this instance, optionally updating it with the given values.
@@ -6113,7 +6192,7 @@ export class Block extends Ignore {
6113
6192
  async toJsonLd(options = {}) {
6114
6193
  options = {
6115
6194
  ...options,
6116
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
6195
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
6117
6196
  };
6118
6197
  // deno-lint-ignore no-unused-vars prefer-const
6119
6198
  let array;
@@ -6126,9 +6205,9 @@ export class Block extends Ignore {
6126
6205
  if (this.id)
6127
6206
  values["@id"] = this.id.href;
6128
6207
  if (options.expand) {
6129
- return await jsonld.expand(values, options);
6208
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
6130
6209
  }
6131
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
6210
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
6132
6211
  }
6133
6212
  /**
6134
6213
  * Converts a JSON-LD structure to an object of this type.
@@ -6145,6 +6224,7 @@ export class Block extends Ignore {
6145
6224
  options = {
6146
6225
  ...options,
6147
6226
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
6227
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
6148
6228
  };
6149
6229
  // deno-lint-ignore no-explicit-any
6150
6230
  let values;
@@ -6153,7 +6233,7 @@ export class Block extends Ignore {
6153
6233
  }
6154
6234
  else {
6155
6235
  const expanded = await jsonld.expand(json, {
6156
- ...options,
6236
+ documentLoader: options.contextLoader,
6157
6237
  keepFreeFloatingNodes: true,
6158
6238
  });
6159
6239
  values =
@@ -6207,8 +6287,8 @@ export class Collection extends Object {
6207
6287
  * @param values The values to initialize the instance with.
6208
6288
  * @param options The options to use for initialization.
6209
6289
  */
6210
- constructor(values, { documentLoader } = {}) {
6211
- super(values, { documentLoader });
6290
+ constructor(values, { documentLoader, contextLoader, } = {}) {
6291
+ super(values, { documentLoader, contextLoader });
6212
6292
  if ("totalItems" in values && values.totalItems != null) {
6213
6293
  this.#_XDbmNDuWHmrhqH712zqtecdbv1V = [values.totalItems];
6214
6294
  }
@@ -6267,16 +6347,18 @@ export class Collection extends Object {
6267
6347
  async #fetchCurrent(url, options = {}) {
6268
6348
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6269
6349
  fetchDocumentLoader;
6350
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
6351
+ fetchDocumentLoader;
6270
6352
  const { document } = await documentLoader(url.href);
6271
6353
  try {
6272
- return await CollectionPage.fromJsonLd(document, { documentLoader });
6354
+ return await CollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
6273
6355
  }
6274
6356
  catch (e) {
6275
6357
  if (!(e instanceof TypeError))
6276
6358
  throw e;
6277
6359
  }
6278
6360
  try {
6279
- return await Link.fromJsonLd(document, { documentLoader });
6361
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6280
6362
  }
6281
6363
  catch (e) {
6282
6364
  if (!(e instanceof TypeError))
@@ -6318,16 +6400,18 @@ export class Collection extends Object {
6318
6400
  async #fetchFirst(url, options = {}) {
6319
6401
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6320
6402
  fetchDocumentLoader;
6403
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
6404
+ fetchDocumentLoader;
6321
6405
  const { document } = await documentLoader(url.href);
6322
6406
  try {
6323
- return await CollectionPage.fromJsonLd(document, { documentLoader });
6407
+ return await CollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
6324
6408
  }
6325
6409
  catch (e) {
6326
6410
  if (!(e instanceof TypeError))
6327
6411
  throw e;
6328
6412
  }
6329
6413
  try {
6330
- return await Link.fromJsonLd(document, { documentLoader });
6414
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6331
6415
  }
6332
6416
  catch (e) {
6333
6417
  if (!(e instanceof TypeError))
@@ -6369,16 +6453,18 @@ export class Collection extends Object {
6369
6453
  async #fetchLast(url, options = {}) {
6370
6454
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6371
6455
  fetchDocumentLoader;
6456
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
6457
+ fetchDocumentLoader;
6372
6458
  const { document } = await documentLoader(url.href);
6373
6459
  try {
6374
- return await CollectionPage.fromJsonLd(document, { documentLoader });
6460
+ return await CollectionPage.fromJsonLd(document, { documentLoader, contextLoader });
6375
6461
  }
6376
6462
  catch (e) {
6377
6463
  if (!(e instanceof TypeError))
6378
6464
  throw e;
6379
6465
  }
6380
6466
  try {
6381
- return await Link.fromJsonLd(document, { documentLoader });
6467
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6382
6468
  }
6383
6469
  catch (e) {
6384
6470
  if (!(e instanceof TypeError))
@@ -6420,16 +6506,18 @@ export class Collection extends Object {
6420
6506
  async #fetchItem(url, options = {}) {
6421
6507
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6422
6508
  fetchDocumentLoader;
6509
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
6510
+ fetchDocumentLoader;
6423
6511
  const { document } = await documentLoader(url.href);
6424
6512
  try {
6425
- return await Object.fromJsonLd(document, { documentLoader });
6513
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
6426
6514
  }
6427
6515
  catch (e) {
6428
6516
  if (!(e instanceof TypeError))
6429
6517
  throw e;
6430
6518
  }
6431
6519
  try {
6432
- return await Link.fromJsonLd(document, { documentLoader });
6520
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6433
6521
  }
6434
6522
  catch (e) {
6435
6523
  if (!(e instanceof TypeError))
@@ -6472,7 +6560,7 @@ export class Collection extends Object {
6472
6560
  async toJsonLd(options = {}) {
6473
6561
  options = {
6474
6562
  ...options,
6475
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
6563
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
6476
6564
  };
6477
6565
  // deno-lint-ignore no-unused-vars prefer-const
6478
6566
  let array;
@@ -6539,9 +6627,9 @@ export class Collection extends Object {
6539
6627
  if (this.id)
6540
6628
  values["@id"] = this.id.href;
6541
6629
  if (options.expand) {
6542
- return await jsonld.expand(values, options);
6630
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
6543
6631
  }
6544
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
6632
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
6545
6633
  }
6546
6634
  /**
6547
6635
  * Converts a JSON-LD structure to an object of this type.
@@ -6558,6 +6646,7 @@ export class Collection extends Object {
6558
6646
  options = {
6559
6647
  ...options,
6560
6648
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
6649
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
6561
6650
  };
6562
6651
  // deno-lint-ignore no-explicit-any
6563
6652
  let values;
@@ -6566,7 +6655,7 @@ export class Collection extends Object {
6566
6655
  }
6567
6656
  else {
6568
6657
  const expanded = await jsonld.expand(json, {
6569
- ...options,
6658
+ documentLoader: options.contextLoader,
6570
6659
  keepFreeFloatingNodes: true,
6571
6660
  });
6572
6661
  values =
@@ -6845,8 +6934,8 @@ export class CollectionPage extends Collection {
6845
6934
  * @param values The values to initialize the instance with.
6846
6935
  * @param options The options to use for initialization.
6847
6936
  */
6848
- constructor(values, { documentLoader } = {}) {
6849
- super(values, { documentLoader });
6937
+ constructor(values, { documentLoader, contextLoader, } = {}) {
6938
+ super(values, { documentLoader, contextLoader });
6850
6939
  if ("partOf" in values && values.partOf != null) {
6851
6940
  this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le = [values.partOf];
6852
6941
  }
@@ -6882,16 +6971,18 @@ export class CollectionPage extends Collection {
6882
6971
  async #fetchPartOf(url, options = {}) {
6883
6972
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6884
6973
  fetchDocumentLoader;
6974
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
6975
+ fetchDocumentLoader;
6885
6976
  const { document } = await documentLoader(url.href);
6886
6977
  try {
6887
- return await Link.fromJsonLd(document, { documentLoader });
6978
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6888
6979
  }
6889
6980
  catch (e) {
6890
6981
  if (!(e instanceof TypeError))
6891
6982
  throw e;
6892
6983
  }
6893
6984
  try {
6894
- return await Collection.fromJsonLd(document, { documentLoader });
6985
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
6895
6986
  }
6896
6987
  catch (e) {
6897
6988
  if (!(e instanceof TypeError))
@@ -6933,16 +7024,18 @@ export class CollectionPage extends Collection {
6933
7024
  async #fetchNext(url, options = {}) {
6934
7025
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6935
7026
  fetchDocumentLoader;
7027
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
7028
+ fetchDocumentLoader;
6936
7029
  const { document } = await documentLoader(url.href);
6937
7030
  try {
6938
- return await _b.fromJsonLd(document, { documentLoader });
7031
+ return await _b.fromJsonLd(document, { documentLoader, contextLoader });
6939
7032
  }
6940
7033
  catch (e) {
6941
7034
  if (!(e instanceof TypeError))
6942
7035
  throw e;
6943
7036
  }
6944
7037
  try {
6945
- return await Link.fromJsonLd(document, { documentLoader });
7038
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6946
7039
  }
6947
7040
  catch (e) {
6948
7041
  if (!(e instanceof TypeError))
@@ -6983,16 +7076,18 @@ export class CollectionPage extends Collection {
6983
7076
  async #fetchPrev(url, options = {}) {
6984
7077
  const documentLoader = options.documentLoader ?? this._documentLoader ??
6985
7078
  fetchDocumentLoader;
7079
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
7080
+ fetchDocumentLoader;
6986
7081
  const { document } = await documentLoader(url.href);
6987
7082
  try {
6988
- return await _b.fromJsonLd(document, { documentLoader });
7083
+ return await _b.fromJsonLd(document, { documentLoader, contextLoader });
6989
7084
  }
6990
7085
  catch (e) {
6991
7086
  if (!(e instanceof TypeError))
6992
7087
  throw e;
6993
7088
  }
6994
7089
  try {
6995
- return await Link.fromJsonLd(document, { documentLoader });
7090
+ return await Link.fromJsonLd(document, { documentLoader, contextLoader });
6996
7091
  }
6997
7092
  catch (e) {
6998
7093
  if (!(e instanceof TypeError))
@@ -7037,7 +7132,7 @@ export class CollectionPage extends Collection {
7037
7132
  async toJsonLd(options = {}) {
7038
7133
  options = {
7039
7134
  ...options,
7040
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
7135
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7041
7136
  };
7042
7137
  // deno-lint-ignore no-unused-vars prefer-const
7043
7138
  let array;
@@ -7083,9 +7178,9 @@ export class CollectionPage extends Collection {
7083
7178
  if (this.id)
7084
7179
  values["@id"] = this.id.href;
7085
7180
  if (options.expand) {
7086
- return await jsonld.expand(values, options);
7181
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
7087
7182
  }
7088
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
7183
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7089
7184
  }
7090
7185
  /**
7091
7186
  * Converts a JSON-LD structure to an object of this type.
@@ -7102,6 +7197,7 @@ export class CollectionPage extends Collection {
7102
7197
  options = {
7103
7198
  ...options,
7104
7199
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
7200
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7105
7201
  };
7106
7202
  // deno-lint-ignore no-explicit-any
7107
7203
  let values;
@@ -7110,7 +7206,7 @@ export class CollectionPage extends Collection {
7110
7206
  }
7111
7207
  else {
7112
7208
  const expanded = await jsonld.expand(json, {
7113
- ...options,
7209
+ documentLoader: options.contextLoader,
7114
7210
  keepFreeFloatingNodes: true,
7115
7211
  });
7116
7212
  values =
@@ -7282,8 +7378,8 @@ export class Create extends Activity {
7282
7378
  * @param values The values to initialize the instance with.
7283
7379
  * @param options The options to use for initialization.
7284
7380
  */
7285
- constructor(values, { documentLoader } = {}) {
7286
- super(values, { documentLoader });
7381
+ constructor(values, { documentLoader, contextLoader, } = {}) {
7382
+ super(values, { documentLoader, contextLoader });
7287
7383
  }
7288
7384
  /**
7289
7385
  * Clones this instance, optionally updating it with the given values.
@@ -7302,7 +7398,7 @@ export class Create extends Activity {
7302
7398
  async toJsonLd(options = {}) {
7303
7399
  options = {
7304
7400
  ...options,
7305
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
7401
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7306
7402
  };
7307
7403
  // deno-lint-ignore no-unused-vars prefer-const
7308
7404
  let array;
@@ -7315,9 +7411,9 @@ export class Create extends Activity {
7315
7411
  if (this.id)
7316
7412
  values["@id"] = this.id.href;
7317
7413
  if (options.expand) {
7318
- return await jsonld.expand(values, options);
7414
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
7319
7415
  }
7320
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
7416
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7321
7417
  }
7322
7418
  /**
7323
7419
  * Converts a JSON-LD structure to an object of this type.
@@ -7334,6 +7430,7 @@ export class Create extends Activity {
7334
7430
  options = {
7335
7431
  ...options,
7336
7432
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
7433
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7337
7434
  };
7338
7435
  // deno-lint-ignore no-explicit-any
7339
7436
  let values;
@@ -7342,7 +7439,7 @@ export class Create extends Activity {
7342
7439
  }
7343
7440
  else {
7344
7441
  const expanded = await jsonld.expand(json, {
7345
- ...options,
7442
+ documentLoader: options.contextLoader,
7346
7443
  keepFreeFloatingNodes: true,
7347
7444
  });
7348
7445
  values =
@@ -7388,8 +7485,8 @@ export class Delete extends Activity {
7388
7485
  * @param values The values to initialize the instance with.
7389
7486
  * @param options The options to use for initialization.
7390
7487
  */
7391
- constructor(values, { documentLoader } = {}) {
7392
- super(values, { documentLoader });
7488
+ constructor(values, { documentLoader, contextLoader, } = {}) {
7489
+ super(values, { documentLoader, contextLoader });
7393
7490
  }
7394
7491
  /**
7395
7492
  * Clones this instance, optionally updating it with the given values.
@@ -7408,7 +7505,7 @@ export class Delete extends Activity {
7408
7505
  async toJsonLd(options = {}) {
7409
7506
  options = {
7410
7507
  ...options,
7411
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
7508
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7412
7509
  };
7413
7510
  // deno-lint-ignore no-unused-vars prefer-const
7414
7511
  let array;
@@ -7421,9 +7518,9 @@ export class Delete extends Activity {
7421
7518
  if (this.id)
7422
7519
  values["@id"] = this.id.href;
7423
7520
  if (options.expand) {
7424
- return await jsonld.expand(values, options);
7521
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
7425
7522
  }
7426
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
7523
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7427
7524
  }
7428
7525
  /**
7429
7526
  * Converts a JSON-LD structure to an object of this type.
@@ -7440,6 +7537,7 @@ export class Delete extends Activity {
7440
7537
  options = {
7441
7538
  ...options,
7442
7539
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
7540
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7443
7541
  };
7444
7542
  // deno-lint-ignore no-explicit-any
7445
7543
  let values;
@@ -7448,7 +7546,7 @@ export class Delete extends Activity {
7448
7546
  }
7449
7547
  else {
7450
7548
  const expanded = await jsonld.expand(json, {
7451
- ...options,
7549
+ documentLoader: options.contextLoader,
7452
7550
  keepFreeFloatingNodes: true,
7453
7551
  });
7454
7552
  values =
@@ -7493,8 +7591,8 @@ export class Dislike extends Activity {
7493
7591
  * @param values The values to initialize the instance with.
7494
7592
  * @param options The options to use for initialization.
7495
7593
  */
7496
- constructor(values, { documentLoader } = {}) {
7497
- super(values, { documentLoader });
7594
+ constructor(values, { documentLoader, contextLoader, } = {}) {
7595
+ super(values, { documentLoader, contextLoader });
7498
7596
  }
7499
7597
  /**
7500
7598
  * Clones this instance, optionally updating it with the given values.
@@ -7513,7 +7611,7 @@ export class Dislike extends Activity {
7513
7611
  async toJsonLd(options = {}) {
7514
7612
  options = {
7515
7613
  ...options,
7516
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
7614
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7517
7615
  };
7518
7616
  // deno-lint-ignore no-unused-vars prefer-const
7519
7617
  let array;
@@ -7526,9 +7624,9 @@ export class Dislike extends Activity {
7526
7624
  if (this.id)
7527
7625
  values["@id"] = this.id.href;
7528
7626
  if (options.expand) {
7529
- return await jsonld.expand(values, options);
7627
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
7530
7628
  }
7531
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
7629
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7532
7630
  }
7533
7631
  /**
7534
7632
  * Converts a JSON-LD structure to an object of this type.
@@ -7545,6 +7643,7 @@ export class Dislike extends Activity {
7545
7643
  options = {
7546
7644
  ...options,
7547
7645
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
7646
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7548
7647
  };
7549
7648
  // deno-lint-ignore no-explicit-any
7550
7649
  let values;
@@ -7553,7 +7652,7 @@ export class Dislike extends Activity {
7553
7652
  }
7554
7653
  else {
7555
7654
  const expanded = await jsonld.expand(json, {
7556
- ...options,
7655
+ documentLoader: options.contextLoader,
7557
7656
  keepFreeFloatingNodes: true,
7558
7657
  });
7559
7658
  values =
@@ -7588,10 +7687,14 @@ export class Dislike extends Activity {
7588
7687
  */
7589
7688
  export class Endpoints {
7590
7689
  #documentLoader;
7690
+ #contextLoader;
7591
7691
  id;
7592
7692
  get _documentLoader() {
7593
7693
  return this.#documentLoader;
7594
7694
  }
7695
+ get _contextLoader() {
7696
+ return this.#contextLoader;
7697
+ }
7595
7698
  /**
7596
7699
  * The type URI of {@link Endpoints}: `https://www.w3.org/ns/activitystreams#Endpoints`.
7597
7700
  */
@@ -7609,8 +7712,9 @@ export class Endpoints {
7609
7712
  * @param values The values to initialize the instance with.
7610
7713
  * @param options The options to use for initialization.
7611
7714
  */
7612
- constructor(values, { documentLoader } = {}) {
7715
+ constructor(values, { documentLoader, contextLoader, } = {}) {
7613
7716
  this.#documentLoader = documentLoader;
7717
+ this.#contextLoader = contextLoader;
7614
7718
  this.id = values.id ?? null;
7615
7719
  if ("proxyUrl" in values && values.proxyUrl != null) {
7616
7720
  this.#_2JCYDbSxEHCCLdBYed33cCETfGyR = [values.proxyUrl];
@@ -7742,7 +7846,7 @@ export class Endpoints {
7742
7846
  async toJsonLd(options = {}) {
7743
7847
  options = {
7744
7848
  ...options,
7745
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
7849
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7746
7850
  };
7747
7851
  // deno-lint-ignore no-unused-vars prefer-const
7748
7852
  let array;
@@ -7794,9 +7898,9 @@ export class Endpoints {
7794
7898
  if (this.id)
7795
7899
  values["@id"] = this.id.href;
7796
7900
  if (options.expand) {
7797
- return await jsonld.expand(values, options);
7901
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
7798
7902
  }
7799
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
7903
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
7800
7904
  }
7801
7905
  /**
7802
7906
  * Converts a JSON-LD structure to an object of this type.
@@ -7813,6 +7917,7 @@ export class Endpoints {
7813
7917
  options = {
7814
7918
  ...options,
7815
7919
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
7920
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
7816
7921
  };
7817
7922
  // deno-lint-ignore no-explicit-any
7818
7923
  let values;
@@ -7821,7 +7926,7 @@ export class Endpoints {
7821
7926
  }
7822
7927
  else {
7823
7928
  const expanded = await jsonld.expand(json, {
7824
- ...options,
7929
+ documentLoader: options.contextLoader,
7825
7930
  keepFreeFloatingNodes: true,
7826
7931
  });
7827
7932
  values =
@@ -7833,7 +7938,7 @@ export class Endpoints {
7833
7938
  throw new TypeError("Invalid type: " + values["@type"]);
7834
7939
  }
7835
7940
  }
7836
- const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, { documentLoader: options?.documentLoader });
7941
+ const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
7837
7942
  const _2JCYDbSxEHCCLdBYed33cCETfGyR = [];
7838
7943
  for (const v of values["https://www.w3.org/ns/activitystreams#proxyUrl"] ?? []) {
7839
7944
  if (v == null)
@@ -7980,8 +8085,8 @@ export class Event extends Object {
7980
8085
  * @param values The values to initialize the instance with.
7981
8086
  * @param options The options to use for initialization.
7982
8087
  */
7983
- constructor(values, { documentLoader } = {}) {
7984
- super(values, { documentLoader });
8088
+ constructor(values, { documentLoader, contextLoader, } = {}) {
8089
+ super(values, { documentLoader, contextLoader });
7985
8090
  }
7986
8091
  /**
7987
8092
  * Clones this instance, optionally updating it with the given values.
@@ -8000,7 +8105,7 @@ export class Event extends Object {
8000
8105
  async toJsonLd(options = {}) {
8001
8106
  options = {
8002
8107
  ...options,
8003
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
8108
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8004
8109
  };
8005
8110
  // deno-lint-ignore no-unused-vars prefer-const
8006
8111
  let array;
@@ -8013,9 +8118,9 @@ export class Event extends Object {
8013
8118
  if (this.id)
8014
8119
  values["@id"] = this.id.href;
8015
8120
  if (options.expand) {
8016
- return await jsonld.expand(values, options);
8121
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
8017
8122
  }
8018
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
8123
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8019
8124
  }
8020
8125
  /**
8021
8126
  * Converts a JSON-LD structure to an object of this type.
@@ -8032,6 +8137,7 @@ export class Event extends Object {
8032
8137
  options = {
8033
8138
  ...options,
8034
8139
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
8140
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8035
8141
  };
8036
8142
  // deno-lint-ignore no-explicit-any
8037
8143
  let values;
@@ -8040,7 +8146,7 @@ export class Event extends Object {
8040
8146
  }
8041
8147
  else {
8042
8148
  const expanded = await jsonld.expand(json, {
8043
- ...options,
8149
+ documentLoader: options.contextLoader,
8044
8150
  keepFreeFloatingNodes: true,
8045
8151
  });
8046
8152
  values =
@@ -8087,8 +8193,8 @@ export class Flag extends Activity {
8087
8193
  * @param values The values to initialize the instance with.
8088
8194
  * @param options The options to use for initialization.
8089
8195
  */
8090
- constructor(values, { documentLoader } = {}) {
8091
- super(values, { documentLoader });
8196
+ constructor(values, { documentLoader, contextLoader, } = {}) {
8197
+ super(values, { documentLoader, contextLoader });
8092
8198
  }
8093
8199
  /**
8094
8200
  * Clones this instance, optionally updating it with the given values.
@@ -8107,7 +8213,7 @@ export class Flag extends Activity {
8107
8213
  async toJsonLd(options = {}) {
8108
8214
  options = {
8109
8215
  ...options,
8110
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
8216
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8111
8217
  };
8112
8218
  // deno-lint-ignore no-unused-vars prefer-const
8113
8219
  let array;
@@ -8120,9 +8226,9 @@ export class Flag extends Activity {
8120
8226
  if (this.id)
8121
8227
  values["@id"] = this.id.href;
8122
8228
  if (options.expand) {
8123
- return await jsonld.expand(values, options);
8229
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
8124
8230
  }
8125
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
8231
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8126
8232
  }
8127
8233
  /**
8128
8234
  * Converts a JSON-LD structure to an object of this type.
@@ -8139,6 +8245,7 @@ export class Flag extends Activity {
8139
8245
  options = {
8140
8246
  ...options,
8141
8247
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
8248
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8142
8249
  };
8143
8250
  // deno-lint-ignore no-explicit-any
8144
8251
  let values;
@@ -8147,7 +8254,7 @@ export class Flag extends Activity {
8147
8254
  }
8148
8255
  else {
8149
8256
  const expanded = await jsonld.expand(json, {
8150
- ...options,
8257
+ documentLoader: options.contextLoader,
8151
8258
  keepFreeFloatingNodes: true,
8152
8259
  });
8153
8260
  values =
@@ -8195,8 +8302,8 @@ export class Follow extends Activity {
8195
8302
  * @param values The values to initialize the instance with.
8196
8303
  * @param options The options to use for initialization.
8197
8304
  */
8198
- constructor(values, { documentLoader } = {}) {
8199
- super(values, { documentLoader });
8305
+ constructor(values, { documentLoader, contextLoader, } = {}) {
8306
+ super(values, { documentLoader, contextLoader });
8200
8307
  }
8201
8308
  /**
8202
8309
  * Clones this instance, optionally updating it with the given values.
@@ -8215,7 +8322,7 @@ export class Follow extends Activity {
8215
8322
  async toJsonLd(options = {}) {
8216
8323
  options = {
8217
8324
  ...options,
8218
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
8325
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8219
8326
  };
8220
8327
  // deno-lint-ignore no-unused-vars prefer-const
8221
8328
  let array;
@@ -8228,9 +8335,9 @@ export class Follow extends Activity {
8228
8335
  if (this.id)
8229
8336
  values["@id"] = this.id.href;
8230
8337
  if (options.expand) {
8231
- return await jsonld.expand(values, options);
8338
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
8232
8339
  }
8233
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
8340
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
8234
8341
  }
8235
8342
  /**
8236
8343
  * Converts a JSON-LD structure to an object of this type.
@@ -8247,6 +8354,7 @@ export class Follow extends Activity {
8247
8354
  options = {
8248
8355
  ...options,
8249
8356
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
8357
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8250
8358
  };
8251
8359
  // deno-lint-ignore no-explicit-any
8252
8360
  let values;
@@ -8255,7 +8363,7 @@ export class Follow extends Activity {
8255
8363
  }
8256
8364
  else {
8257
8365
  const expanded = await jsonld.expand(json, {
8258
- ...options,
8366
+ documentLoader: options.contextLoader,
8259
8367
  keepFreeFloatingNodes: true,
8260
8368
  });
8261
8369
  values =
@@ -8314,8 +8422,8 @@ export class Group extends Object {
8314
8422
  * @param values The values to initialize the instance with.
8315
8423
  * @param options The options to use for initialization.
8316
8424
  */
8317
- constructor(values, { documentLoader } = {}) {
8318
- super(values, { documentLoader });
8425
+ constructor(values, { documentLoader, contextLoader, } = {}) {
8426
+ super(values, { documentLoader, contextLoader });
8319
8427
  if ("preferredUsername" in values && values.preferredUsername != null) {
8320
8428
  this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [values.preferredUsername];
8321
8429
  }
@@ -8476,9 +8584,11 @@ export class Group extends Object {
8476
8584
  async #fetchPublicKey(url, options = {}) {
8477
8585
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8478
8586
  fetchDocumentLoader;
8587
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8588
+ fetchDocumentLoader;
8479
8589
  const { document } = await documentLoader(url.href);
8480
8590
  try {
8481
- return await CryptographicKey.fromJsonLd(document, { documentLoader });
8591
+ return await CryptographicKey.fromJsonLd(document, { documentLoader, contextLoader });
8482
8592
  }
8483
8593
  catch (e) {
8484
8594
  if (!(e instanceof TypeError))
@@ -8551,9 +8661,11 @@ export class Group extends Object {
8551
8661
  async #fetchInbox(url, options = {}) {
8552
8662
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8553
8663
  fetchDocumentLoader;
8664
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8665
+ fetchDocumentLoader;
8554
8666
  const { document } = await documentLoader(url.href);
8555
8667
  try {
8556
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
8668
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
8557
8669
  }
8558
8670
  catch (e) {
8559
8671
  if (!(e instanceof TypeError))
@@ -8603,9 +8715,11 @@ export class Group extends Object {
8603
8715
  async #fetchOutbox(url, options = {}) {
8604
8716
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8605
8717
  fetchDocumentLoader;
8718
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8719
+ fetchDocumentLoader;
8606
8720
  const { document } = await documentLoader(url.href);
8607
8721
  try {
8608
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
8722
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
8609
8723
  }
8610
8724
  catch (e) {
8611
8725
  if (!(e instanceof TypeError))
@@ -8652,9 +8766,11 @@ export class Group extends Object {
8652
8766
  async #fetchFollowing(url, options = {}) {
8653
8767
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8654
8768
  fetchDocumentLoader;
8769
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8770
+ fetchDocumentLoader;
8655
8771
  const { document } = await documentLoader(url.href);
8656
8772
  try {
8657
- return await Collection.fromJsonLd(document, { documentLoader });
8773
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
8658
8774
  }
8659
8775
  catch (e) {
8660
8776
  if (!(e instanceof TypeError))
@@ -8696,9 +8812,11 @@ export class Group extends Object {
8696
8812
  async #fetchFollowers(url, options = {}) {
8697
8813
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8698
8814
  fetchDocumentLoader;
8815
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8816
+ fetchDocumentLoader;
8699
8817
  const { document } = await documentLoader(url.href);
8700
8818
  try {
8701
- return await Collection.fromJsonLd(document, { documentLoader });
8819
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
8702
8820
  }
8703
8821
  catch (e) {
8704
8822
  if (!(e instanceof TypeError))
@@ -8743,9 +8861,11 @@ export class Group extends Object {
8743
8861
  async #fetchLinked(url, options = {}) {
8744
8862
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8745
8863
  fetchDocumentLoader;
8864
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8865
+ fetchDocumentLoader;
8746
8866
  const { document } = await documentLoader(url.href);
8747
8867
  try {
8748
- return await Collection.fromJsonLd(document, { documentLoader });
8868
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
8749
8869
  }
8750
8870
  catch (e) {
8751
8871
  if (!(e instanceof TypeError))
@@ -8788,9 +8908,11 @@ export class Group extends Object {
8788
8908
  async #fetchStream(url, options = {}) {
8789
8909
  const documentLoader = options.documentLoader ?? this._documentLoader ??
8790
8910
  fetchDocumentLoader;
8911
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
8912
+ fetchDocumentLoader;
8791
8913
  const { document } = await documentLoader(url.href);
8792
8914
  try {
8793
- return await Collection.fromJsonLd(document, { documentLoader });
8915
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
8794
8916
  }
8795
8917
  catch (e) {
8796
8918
  if (!(e instanceof TypeError))
@@ -8871,7 +8993,7 @@ export class Group extends Object {
8871
8993
  async toJsonLd(options = {}) {
8872
8994
  options = {
8873
8995
  ...options,
8874
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
8996
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
8875
8997
  };
8876
8998
  // deno-lint-ignore no-unused-vars prefer-const
8877
8999
  let array;
@@ -8982,7 +9104,7 @@ export class Group extends Object {
8982
9104
  if (this.id)
8983
9105
  values["@id"] = this.id.href;
8984
9106
  if (options.expand) {
8985
- return await jsonld.expand(values, options);
9107
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
8986
9108
  }
8987
9109
  return await jsonld.compact(values, [
8988
9110
  "https://www.w3.org/ns/activitystreams",
@@ -8998,7 +9120,7 @@ export class Group extends Object {
8998
9120
  "PropertyValue": "schema:PropertyValue",
8999
9121
  "value": "schema:value",
9000
9122
  },
9001
- ], options);
9123
+ ], { documentLoader: options.contextLoader });
9002
9124
  }
9003
9125
  /**
9004
9126
  * Converts a JSON-LD structure to an object of this type.
@@ -9015,6 +9137,7 @@ export class Group extends Object {
9015
9137
  options = {
9016
9138
  ...options,
9017
9139
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
9140
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9018
9141
  };
9019
9142
  // deno-lint-ignore no-explicit-any
9020
9143
  let values;
@@ -9023,7 +9146,7 @@ export class Group extends Object {
9023
9146
  }
9024
9147
  else {
9025
9148
  const expanded = await jsonld.expand(json, {
9026
- ...options,
9149
+ documentLoader: options.contextLoader,
9027
9150
  keepFreeFloatingNodes: true,
9028
9151
  });
9029
9152
  values =
@@ -9378,8 +9501,8 @@ export class Image extends Document {
9378
9501
  * @param values The values to initialize the instance with.
9379
9502
  * @param options The options to use for initialization.
9380
9503
  */
9381
- constructor(values, { documentLoader } = {}) {
9382
- super(values, { documentLoader });
9504
+ constructor(values, { documentLoader, contextLoader, } = {}) {
9505
+ super(values, { documentLoader, contextLoader });
9383
9506
  }
9384
9507
  /**
9385
9508
  * Clones this instance, optionally updating it with the given values.
@@ -9398,7 +9521,7 @@ export class Image extends Document {
9398
9521
  async toJsonLd(options = {}) {
9399
9522
  options = {
9400
9523
  ...options,
9401
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
9524
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9402
9525
  };
9403
9526
  // deno-lint-ignore no-unused-vars prefer-const
9404
9527
  let array;
@@ -9411,9 +9534,9 @@ export class Image extends Document {
9411
9534
  if (this.id)
9412
9535
  values["@id"] = this.id.href;
9413
9536
  if (options.expand) {
9414
- return await jsonld.expand(values, options);
9537
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
9415
9538
  }
9416
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
9539
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9417
9540
  }
9418
9541
  /**
9419
9542
  * Converts a JSON-LD structure to an object of this type.
@@ -9430,6 +9553,7 @@ export class Image extends Document {
9430
9553
  options = {
9431
9554
  ...options,
9432
9555
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
9556
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9433
9557
  };
9434
9558
  // deno-lint-ignore no-explicit-any
9435
9559
  let values;
@@ -9438,7 +9562,7 @@ export class Image extends Document {
9438
9562
  }
9439
9563
  else {
9440
9564
  const expanded = await jsonld.expand(json, {
9441
- ...options,
9565
+ documentLoader: options.contextLoader,
9442
9566
  keepFreeFloatingNodes: true,
9443
9567
  });
9444
9568
  values =
@@ -9485,8 +9609,8 @@ export class IntransitiveActivity extends Activity {
9485
9609
  * @param values The values to initialize the instance with.
9486
9610
  * @param options The options to use for initialization.
9487
9611
  */
9488
- constructor(values, { documentLoader } = {}) {
9489
- super(values, { documentLoader });
9612
+ constructor(values, { documentLoader, contextLoader, } = {}) {
9613
+ super(values, { documentLoader, contextLoader });
9490
9614
  }
9491
9615
  /**
9492
9616
  * Clones this instance, optionally updating it with the given values.
@@ -9505,7 +9629,7 @@ export class IntransitiveActivity extends Activity {
9505
9629
  async toJsonLd(options = {}) {
9506
9630
  options = {
9507
9631
  ...options,
9508
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
9632
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9509
9633
  };
9510
9634
  // deno-lint-ignore no-unused-vars prefer-const
9511
9635
  let array;
@@ -9520,9 +9644,9 @@ export class IntransitiveActivity extends Activity {
9520
9644
  if (this.id)
9521
9645
  values["@id"] = this.id.href;
9522
9646
  if (options.expand) {
9523
- return await jsonld.expand(values, options);
9647
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
9524
9648
  }
9525
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
9649
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9526
9650
  }
9527
9651
  /**
9528
9652
  * Converts a JSON-LD structure to an object of this type.
@@ -9539,6 +9663,7 @@ export class IntransitiveActivity extends Activity {
9539
9663
  options = {
9540
9664
  ...options,
9541
9665
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
9666
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9542
9667
  };
9543
9668
  // deno-lint-ignore no-explicit-any
9544
9669
  let values;
@@ -9547,7 +9672,7 @@ export class IntransitiveActivity extends Activity {
9547
9672
  }
9548
9673
  else {
9549
9674
  const expanded = await jsonld.expand(json, {
9550
- ...options,
9675
+ documentLoader: options.contextLoader,
9551
9676
  keepFreeFloatingNodes: true,
9552
9677
  });
9553
9678
  values =
@@ -9593,8 +9718,8 @@ export class Like extends Activity {
9593
9718
  * @param values The values to initialize the instance with.
9594
9719
  * @param options The options to use for initialization.
9595
9720
  */
9596
- constructor(values, { documentLoader } = {}) {
9597
- super(values, { documentLoader });
9721
+ constructor(values, { documentLoader, contextLoader, } = {}) {
9722
+ super(values, { documentLoader, contextLoader });
9598
9723
  }
9599
9724
  /**
9600
9725
  * Clones this instance, optionally updating it with the given values.
@@ -9613,7 +9738,7 @@ export class Like extends Activity {
9613
9738
  async toJsonLd(options = {}) {
9614
9739
  options = {
9615
9740
  ...options,
9616
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
9741
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9617
9742
  };
9618
9743
  // deno-lint-ignore no-unused-vars prefer-const
9619
9744
  let array;
@@ -9626,9 +9751,9 @@ export class Like extends Activity {
9626
9751
  if (this.id)
9627
9752
  values["@id"] = this.id.href;
9628
9753
  if (options.expand) {
9629
- return await jsonld.expand(values, options);
9754
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
9630
9755
  }
9631
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
9756
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
9632
9757
  }
9633
9758
  /**
9634
9759
  * Converts a JSON-LD structure to an object of this type.
@@ -9645,6 +9770,7 @@ export class Like extends Activity {
9645
9770
  options = {
9646
9771
  ...options,
9647
9772
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
9773
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9648
9774
  };
9649
9775
  // deno-lint-ignore no-explicit-any
9650
9776
  let values;
@@ -9653,7 +9779,7 @@ export class Like extends Activity {
9653
9779
  }
9654
9780
  else {
9655
9781
  const expanded = await jsonld.expand(json, {
9656
- ...options,
9782
+ documentLoader: options.contextLoader,
9657
9783
  keepFreeFloatingNodes: true,
9658
9784
  });
9659
9785
  values =
@@ -9695,10 +9821,14 @@ export class Like extends Activity {
9695
9821
  */
9696
9822
  export class Link {
9697
9823
  #documentLoader;
9824
+ #contextLoader;
9698
9825
  id;
9699
9826
  get _documentLoader() {
9700
9827
  return this.#documentLoader;
9701
9828
  }
9829
+ get _contextLoader() {
9830
+ return this.#contextLoader;
9831
+ }
9702
9832
  /**
9703
9833
  * The type URI of {@link Link}: `https://www.w3.org/ns/activitystreams#Link`.
9704
9834
  */
@@ -9718,8 +9848,9 @@ export class Link {
9718
9848
  * @param values The values to initialize the instance with.
9719
9849
  * @param options The options to use for initialization.
9720
9850
  */
9721
- constructor(values, { documentLoader } = {}) {
9851
+ constructor(values, { documentLoader, contextLoader, } = {}) {
9722
9852
  this.#documentLoader = documentLoader;
9853
+ this.#contextLoader = contextLoader;
9723
9854
  this.id = values.id ?? null;
9724
9855
  if ("href" in values && values.href != null) {
9725
9856
  this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7 = [values.href];
@@ -9901,16 +10032,18 @@ export class Link {
9901
10032
  async #fetchPreview(url, options = {}) {
9902
10033
  const documentLoader = options.documentLoader ?? this._documentLoader ??
9903
10034
  fetchDocumentLoader;
10035
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
10036
+ fetchDocumentLoader;
9904
10037
  const { document } = await documentLoader(url.href);
9905
10038
  try {
9906
- return await _c.fromJsonLd(document, { documentLoader });
10039
+ return await _c.fromJsonLd(document, { documentLoader, contextLoader });
9907
10040
  }
9908
10041
  catch (e) {
9909
10042
  if (!(e instanceof TypeError))
9910
10043
  throw e;
9911
10044
  }
9912
10045
  try {
9913
- return await Object.fromJsonLd(document, { documentLoader });
10046
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
9914
10047
  }
9915
10048
  catch (e) {
9916
10049
  if (!(e instanceof TypeError))
@@ -9952,7 +10085,7 @@ export class Link {
9952
10085
  async toJsonLd(options = {}) {
9953
10086
  options = {
9954
10087
  ...options,
9955
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
10088
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
9956
10089
  };
9957
10090
  // deno-lint-ignore no-unused-vars prefer-const
9958
10091
  let array;
@@ -10030,9 +10163,9 @@ export class Link {
10030
10163
  if (this.id)
10031
10164
  values["@id"] = this.id.href;
10032
10165
  if (options.expand) {
10033
- return await jsonld.expand(values, options);
10166
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
10034
10167
  }
10035
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
10168
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
10036
10169
  }
10037
10170
  /**
10038
10171
  * Converts a JSON-LD structure to an object of this type.
@@ -10049,6 +10182,7 @@ export class Link {
10049
10182
  options = {
10050
10183
  ...options,
10051
10184
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
10185
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10052
10186
  };
10053
10187
  // deno-lint-ignore no-explicit-any
10054
10188
  let values;
@@ -10057,7 +10191,7 @@ export class Link {
10057
10191
  }
10058
10192
  else {
10059
10193
  const expanded = await jsonld.expand(json, {
10060
- ...options,
10194
+ documentLoader: options.contextLoader,
10061
10195
  keepFreeFloatingNodes: true,
10062
10196
  });
10063
10197
  values =
@@ -10073,7 +10207,7 @@ export class Link {
10073
10207
  throw new TypeError("Invalid type: " + values["@type"]);
10074
10208
  }
10075
10209
  }
10076
- const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, { documentLoader: options?.documentLoader });
10210
+ const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : undefined }, options);
10077
10211
  const _pVjLsybKQdmkjuU7MHjiVmNnuj7 = [];
10078
10212
  for (const v of values["https://www.w3.org/ns/activitystreams#href"] ?? []) {
10079
10213
  if (v == null)
@@ -10334,8 +10468,8 @@ export class Mention extends Link {
10334
10468
  * @param values The values to initialize the instance with.
10335
10469
  * @param options The options to use for initialization.
10336
10470
  */
10337
- constructor(values, { documentLoader } = {}) {
10338
- super(values, { documentLoader });
10471
+ constructor(values, { documentLoader, contextLoader, } = {}) {
10472
+ super(values, { documentLoader, contextLoader });
10339
10473
  }
10340
10474
  /**
10341
10475
  * Clones this instance, optionally updating it with the given values.
@@ -10354,7 +10488,7 @@ export class Mention extends Link {
10354
10488
  async toJsonLd(options = {}) {
10355
10489
  options = {
10356
10490
  ...options,
10357
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
10491
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10358
10492
  };
10359
10493
  // deno-lint-ignore no-unused-vars prefer-const
10360
10494
  let array;
@@ -10367,9 +10501,9 @@ export class Mention extends Link {
10367
10501
  if (this.id)
10368
10502
  values["@id"] = this.id.href;
10369
10503
  if (options.expand) {
10370
- return await jsonld.expand(values, options);
10504
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
10371
10505
  }
10372
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
10506
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
10373
10507
  }
10374
10508
  /**
10375
10509
  * Converts a JSON-LD structure to an object of this type.
@@ -10386,6 +10520,7 @@ export class Mention extends Link {
10386
10520
  options = {
10387
10521
  ...options,
10388
10522
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
10523
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10389
10524
  };
10390
10525
  // deno-lint-ignore no-explicit-any
10391
10526
  let values;
@@ -10394,7 +10529,7 @@ export class Mention extends Link {
10394
10529
  }
10395
10530
  else {
10396
10531
  const expanded = await jsonld.expand(json, {
10397
- ...options,
10532
+ documentLoader: options.contextLoader,
10398
10533
  keepFreeFloatingNodes: true,
10399
10534
  });
10400
10535
  values =
@@ -10440,8 +10575,8 @@ export class Note extends Object {
10440
10575
  * @param values The values to initialize the instance with.
10441
10576
  * @param options The options to use for initialization.
10442
10577
  */
10443
- constructor(values, { documentLoader } = {}) {
10444
- super(values, { documentLoader });
10578
+ constructor(values, { documentLoader, contextLoader, } = {}) {
10579
+ super(values, { documentLoader, contextLoader });
10445
10580
  }
10446
10581
  /**
10447
10582
  * Clones this instance, optionally updating it with the given values.
@@ -10460,7 +10595,7 @@ export class Note extends Object {
10460
10595
  async toJsonLd(options = {}) {
10461
10596
  options = {
10462
10597
  ...options,
10463
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
10598
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10464
10599
  };
10465
10600
  // deno-lint-ignore no-unused-vars prefer-const
10466
10601
  let array;
@@ -10473,9 +10608,9 @@ export class Note extends Object {
10473
10608
  if (this.id)
10474
10609
  values["@id"] = this.id.href;
10475
10610
  if (options.expand) {
10476
- return await jsonld.expand(values, options);
10611
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
10477
10612
  }
10478
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
10613
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
10479
10614
  }
10480
10615
  /**
10481
10616
  * Converts a JSON-LD structure to an object of this type.
@@ -10492,6 +10627,7 @@ export class Note extends Object {
10492
10627
  options = {
10493
10628
  ...options,
10494
10629
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
10630
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10495
10631
  };
10496
10632
  // deno-lint-ignore no-explicit-any
10497
10633
  let values;
@@ -10500,7 +10636,7 @@ export class Note extends Object {
10500
10636
  }
10501
10637
  else {
10502
10638
  const expanded = await jsonld.expand(json, {
10503
- ...options,
10639
+ documentLoader: options.contextLoader,
10504
10640
  keepFreeFloatingNodes: true,
10505
10641
  });
10506
10642
  values =
@@ -10546,8 +10682,8 @@ export class OrderedCollection extends Collection {
10546
10682
  * @param values The values to initialize the instance with.
10547
10683
  * @param options The options to use for initialization.
10548
10684
  */
10549
- constructor(values, { documentLoader } = {}) {
10550
- super(values, { documentLoader });
10685
+ constructor(values, { documentLoader, contextLoader, } = {}) {
10686
+ super(values, { documentLoader, contextLoader });
10551
10687
  }
10552
10688
  /**
10553
10689
  * Clones this instance, optionally updating it with the given values.
@@ -10566,7 +10702,7 @@ export class OrderedCollection extends Collection {
10566
10702
  async toJsonLd(options = {}) {
10567
10703
  options = {
10568
10704
  ...options,
10569
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
10705
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10570
10706
  };
10571
10707
  // deno-lint-ignore no-unused-vars prefer-const
10572
10708
  let array;
@@ -10581,9 +10717,9 @@ export class OrderedCollection extends Collection {
10581
10717
  if (this.id)
10582
10718
  values["@id"] = this.id.href;
10583
10719
  if (options.expand) {
10584
- return await jsonld.expand(values, options);
10720
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
10585
10721
  }
10586
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
10722
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
10587
10723
  }
10588
10724
  /**
10589
10725
  * Converts a JSON-LD structure to an object of this type.
@@ -10600,6 +10736,7 @@ export class OrderedCollection extends Collection {
10600
10736
  options = {
10601
10737
  ...options,
10602
10738
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
10739
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10603
10740
  };
10604
10741
  // deno-lint-ignore no-explicit-any
10605
10742
  let values;
@@ -10608,7 +10745,7 @@ export class OrderedCollection extends Collection {
10608
10745
  }
10609
10746
  else {
10610
10747
  const expanded = await jsonld.expand(json, {
10611
- ...options,
10748
+ documentLoader: options.contextLoader,
10612
10749
  keepFreeFloatingNodes: true,
10613
10750
  });
10614
10751
  values =
@@ -10656,8 +10793,8 @@ export class OrderedCollectionPage extends CollectionPage {
10656
10793
  * @param values The values to initialize the instance with.
10657
10794
  * @param options The options to use for initialization.
10658
10795
  */
10659
- constructor(values, { documentLoader } = {}) {
10660
- super(values, { documentLoader });
10796
+ constructor(values, { documentLoader, contextLoader, } = {}) {
10797
+ super(values, { documentLoader, contextLoader });
10661
10798
  if ("startIndex" in values && values.startIndex != null) {
10662
10799
  this.#_2W4yinFwqmpneu2h4m1mZ3pcLADd = [values.startIndex];
10663
10800
  }
@@ -10691,7 +10828,7 @@ export class OrderedCollectionPage extends CollectionPage {
10691
10828
  async toJsonLd(options = {}) {
10692
10829
  options = {
10693
10830
  ...options,
10694
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
10831
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10695
10832
  };
10696
10833
  // deno-lint-ignore no-unused-vars prefer-const
10697
10834
  let array;
@@ -10716,9 +10853,9 @@ export class OrderedCollectionPage extends CollectionPage {
10716
10853
  if (this.id)
10717
10854
  values["@id"] = this.id.href;
10718
10855
  if (options.expand) {
10719
- return await jsonld.expand(values, options);
10856
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
10720
10857
  }
10721
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
10858
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
10722
10859
  }
10723
10860
  /**
10724
10861
  * Converts a JSON-LD structure to an object of this type.
@@ -10735,6 +10872,7 @@ export class OrderedCollectionPage extends CollectionPage {
10735
10872
  options = {
10736
10873
  ...options,
10737
10874
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
10875
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
10738
10876
  };
10739
10877
  // deno-lint-ignore no-explicit-any
10740
10878
  let values;
@@ -10743,7 +10881,7 @@ export class OrderedCollectionPage extends CollectionPage {
10743
10881
  }
10744
10882
  else {
10745
10883
  const expanded = await jsonld.expand(json, {
10746
- ...options,
10884
+ documentLoader: options.contextLoader,
10747
10885
  keepFreeFloatingNodes: true,
10748
10886
  });
10749
10887
  values =
@@ -10821,8 +10959,8 @@ export class Organization extends Object {
10821
10959
  * @param values The values to initialize the instance with.
10822
10960
  * @param options The options to use for initialization.
10823
10961
  */
10824
- constructor(values, { documentLoader } = {}) {
10825
- super(values, { documentLoader });
10962
+ constructor(values, { documentLoader, contextLoader, } = {}) {
10963
+ super(values, { documentLoader, contextLoader });
10826
10964
  if ("preferredUsername" in values && values.preferredUsername != null) {
10827
10965
  this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [values.preferredUsername];
10828
10966
  }
@@ -10983,9 +11121,11 @@ export class Organization extends Object {
10983
11121
  async #fetchPublicKey(url, options = {}) {
10984
11122
  const documentLoader = options.documentLoader ?? this._documentLoader ??
10985
11123
  fetchDocumentLoader;
11124
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11125
+ fetchDocumentLoader;
10986
11126
  const { document } = await documentLoader(url.href);
10987
11127
  try {
10988
- return await CryptographicKey.fromJsonLd(document, { documentLoader });
11128
+ return await CryptographicKey.fromJsonLd(document, { documentLoader, contextLoader });
10989
11129
  }
10990
11130
  catch (e) {
10991
11131
  if (!(e instanceof TypeError))
@@ -11058,9 +11198,11 @@ export class Organization extends Object {
11058
11198
  async #fetchInbox(url, options = {}) {
11059
11199
  const documentLoader = options.documentLoader ?? this._documentLoader ??
11060
11200
  fetchDocumentLoader;
11201
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11202
+ fetchDocumentLoader;
11061
11203
  const { document } = await documentLoader(url.href);
11062
11204
  try {
11063
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
11205
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
11064
11206
  }
11065
11207
  catch (e) {
11066
11208
  if (!(e instanceof TypeError))
@@ -11110,9 +11252,11 @@ export class Organization extends Object {
11110
11252
  async #fetchOutbox(url, options = {}) {
11111
11253
  const documentLoader = options.documentLoader ?? this._documentLoader ??
11112
11254
  fetchDocumentLoader;
11255
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11256
+ fetchDocumentLoader;
11113
11257
  const { document } = await documentLoader(url.href);
11114
11258
  try {
11115
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
11259
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
11116
11260
  }
11117
11261
  catch (e) {
11118
11262
  if (!(e instanceof TypeError))
@@ -11159,9 +11303,11 @@ export class Organization extends Object {
11159
11303
  async #fetchFollowing(url, options = {}) {
11160
11304
  const documentLoader = options.documentLoader ?? this._documentLoader ??
11161
11305
  fetchDocumentLoader;
11306
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11307
+ fetchDocumentLoader;
11162
11308
  const { document } = await documentLoader(url.href);
11163
11309
  try {
11164
- return await Collection.fromJsonLd(document, { documentLoader });
11310
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
11165
11311
  }
11166
11312
  catch (e) {
11167
11313
  if (!(e instanceof TypeError))
@@ -11203,9 +11349,11 @@ export class Organization extends Object {
11203
11349
  async #fetchFollowers(url, options = {}) {
11204
11350
  const documentLoader = options.documentLoader ?? this._documentLoader ??
11205
11351
  fetchDocumentLoader;
11352
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11353
+ fetchDocumentLoader;
11206
11354
  const { document } = await documentLoader(url.href);
11207
11355
  try {
11208
- return await Collection.fromJsonLd(document, { documentLoader });
11356
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
11209
11357
  }
11210
11358
  catch (e) {
11211
11359
  if (!(e instanceof TypeError))
@@ -11250,9 +11398,11 @@ export class Organization extends Object {
11250
11398
  async #fetchLinked(url, options = {}) {
11251
11399
  const documentLoader = options.documentLoader ?? this._documentLoader ??
11252
11400
  fetchDocumentLoader;
11401
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11402
+ fetchDocumentLoader;
11253
11403
  const { document } = await documentLoader(url.href);
11254
11404
  try {
11255
- return await Collection.fromJsonLd(document, { documentLoader });
11405
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
11256
11406
  }
11257
11407
  catch (e) {
11258
11408
  if (!(e instanceof TypeError))
@@ -11295,9 +11445,11 @@ export class Organization extends Object {
11295
11445
  async #fetchStream(url, options = {}) {
11296
11446
  const documentLoader = options.documentLoader ?? this._documentLoader ??
11297
11447
  fetchDocumentLoader;
11448
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
11449
+ fetchDocumentLoader;
11298
11450
  const { document } = await documentLoader(url.href);
11299
11451
  try {
11300
- return await Collection.fromJsonLd(document, { documentLoader });
11452
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
11301
11453
  }
11302
11454
  catch (e) {
11303
11455
  if (!(e instanceof TypeError))
@@ -11378,7 +11530,7 @@ export class Organization extends Object {
11378
11530
  async toJsonLd(options = {}) {
11379
11531
  options = {
11380
11532
  ...options,
11381
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
11533
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
11382
11534
  };
11383
11535
  // deno-lint-ignore no-unused-vars prefer-const
11384
11536
  let array;
@@ -11489,7 +11641,7 @@ export class Organization extends Object {
11489
11641
  if (this.id)
11490
11642
  values["@id"] = this.id.href;
11491
11643
  if (options.expand) {
11492
- return await jsonld.expand(values, options);
11644
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
11493
11645
  }
11494
11646
  return await jsonld.compact(values, [
11495
11647
  "https://www.w3.org/ns/activitystreams",
@@ -11505,7 +11657,7 @@ export class Organization extends Object {
11505
11657
  "PropertyValue": "schema:PropertyValue",
11506
11658
  "value": "schema:value",
11507
11659
  },
11508
- ], options);
11660
+ ], { documentLoader: options.contextLoader });
11509
11661
  }
11510
11662
  /**
11511
11663
  * Converts a JSON-LD structure to an object of this type.
@@ -11522,6 +11674,7 @@ export class Organization extends Object {
11522
11674
  options = {
11523
11675
  ...options,
11524
11676
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
11677
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
11525
11678
  };
11526
11679
  // deno-lint-ignore no-explicit-any
11527
11680
  let values;
@@ -11530,7 +11683,7 @@ export class Organization extends Object {
11530
11683
  }
11531
11684
  else {
11532
11685
  const expanded = await jsonld.expand(json, {
11533
- ...options,
11686
+ documentLoader: options.contextLoader,
11534
11687
  keepFreeFloatingNodes: true,
11535
11688
  });
11536
11689
  values =
@@ -11885,8 +12038,8 @@ export class Page extends Document {
11885
12038
  * @param values The values to initialize the instance with.
11886
12039
  * @param options The options to use for initialization.
11887
12040
  */
11888
- constructor(values, { documentLoader } = {}) {
11889
- super(values, { documentLoader });
12041
+ constructor(values, { documentLoader, contextLoader, } = {}) {
12042
+ super(values, { documentLoader, contextLoader });
11890
12043
  }
11891
12044
  /**
11892
12045
  * Clones this instance, optionally updating it with the given values.
@@ -11905,7 +12058,7 @@ export class Page extends Document {
11905
12058
  async toJsonLd(options = {}) {
11906
12059
  options = {
11907
12060
  ...options,
11908
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
12061
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
11909
12062
  };
11910
12063
  // deno-lint-ignore no-unused-vars prefer-const
11911
12064
  let array;
@@ -11918,9 +12071,9 @@ export class Page extends Document {
11918
12071
  if (this.id)
11919
12072
  values["@id"] = this.id.href;
11920
12073
  if (options.expand) {
11921
- return await jsonld.expand(values, options);
12074
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
11922
12075
  }
11923
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
12076
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
11924
12077
  }
11925
12078
  /**
11926
12079
  * Converts a JSON-LD structure to an object of this type.
@@ -11937,6 +12090,7 @@ export class Page extends Document {
11937
12090
  options = {
11938
12091
  ...options,
11939
12092
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
12093
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
11940
12094
  };
11941
12095
  // deno-lint-ignore no-explicit-any
11942
12096
  let values;
@@ -11945,7 +12099,7 @@ export class Page extends Document {
11945
12099
  }
11946
12100
  else {
11947
12101
  const expanded = await jsonld.expand(json, {
11948
- ...options,
12102
+ documentLoader: options.contextLoader,
11949
12103
  keepFreeFloatingNodes: true,
11950
12104
  });
11951
12105
  values =
@@ -12004,8 +12158,8 @@ export class Person extends Object {
12004
12158
  * @param values The values to initialize the instance with.
12005
12159
  * @param options The options to use for initialization.
12006
12160
  */
12007
- constructor(values, { documentLoader } = {}) {
12008
- super(values, { documentLoader });
12161
+ constructor(values, { documentLoader, contextLoader, } = {}) {
12162
+ super(values, { documentLoader, contextLoader });
12009
12163
  if ("preferredUsername" in values && values.preferredUsername != null) {
12010
12164
  this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [values.preferredUsername];
12011
12165
  }
@@ -12166,9 +12320,11 @@ export class Person extends Object {
12166
12320
  async #fetchPublicKey(url, options = {}) {
12167
12321
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12168
12322
  fetchDocumentLoader;
12323
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12324
+ fetchDocumentLoader;
12169
12325
  const { document } = await documentLoader(url.href);
12170
12326
  try {
12171
- return await CryptographicKey.fromJsonLd(document, { documentLoader });
12327
+ return await CryptographicKey.fromJsonLd(document, { documentLoader, contextLoader });
12172
12328
  }
12173
12329
  catch (e) {
12174
12330
  if (!(e instanceof TypeError))
@@ -12241,9 +12397,11 @@ export class Person extends Object {
12241
12397
  async #fetchInbox(url, options = {}) {
12242
12398
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12243
12399
  fetchDocumentLoader;
12400
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12401
+ fetchDocumentLoader;
12244
12402
  const { document } = await documentLoader(url.href);
12245
12403
  try {
12246
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
12404
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
12247
12405
  }
12248
12406
  catch (e) {
12249
12407
  if (!(e instanceof TypeError))
@@ -12293,9 +12451,11 @@ export class Person extends Object {
12293
12451
  async #fetchOutbox(url, options = {}) {
12294
12452
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12295
12453
  fetchDocumentLoader;
12454
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12455
+ fetchDocumentLoader;
12296
12456
  const { document } = await documentLoader(url.href);
12297
12457
  try {
12298
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
12458
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
12299
12459
  }
12300
12460
  catch (e) {
12301
12461
  if (!(e instanceof TypeError))
@@ -12342,9 +12502,11 @@ export class Person extends Object {
12342
12502
  async #fetchFollowing(url, options = {}) {
12343
12503
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12344
12504
  fetchDocumentLoader;
12505
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12506
+ fetchDocumentLoader;
12345
12507
  const { document } = await documentLoader(url.href);
12346
12508
  try {
12347
- return await Collection.fromJsonLd(document, { documentLoader });
12509
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
12348
12510
  }
12349
12511
  catch (e) {
12350
12512
  if (!(e instanceof TypeError))
@@ -12386,9 +12548,11 @@ export class Person extends Object {
12386
12548
  async #fetchFollowers(url, options = {}) {
12387
12549
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12388
12550
  fetchDocumentLoader;
12551
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12552
+ fetchDocumentLoader;
12389
12553
  const { document } = await documentLoader(url.href);
12390
12554
  try {
12391
- return await Collection.fromJsonLd(document, { documentLoader });
12555
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
12392
12556
  }
12393
12557
  catch (e) {
12394
12558
  if (!(e instanceof TypeError))
@@ -12433,9 +12597,11 @@ export class Person extends Object {
12433
12597
  async #fetchLinked(url, options = {}) {
12434
12598
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12435
12599
  fetchDocumentLoader;
12600
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12601
+ fetchDocumentLoader;
12436
12602
  const { document } = await documentLoader(url.href);
12437
12603
  try {
12438
- return await Collection.fromJsonLd(document, { documentLoader });
12604
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
12439
12605
  }
12440
12606
  catch (e) {
12441
12607
  if (!(e instanceof TypeError))
@@ -12478,9 +12644,11 @@ export class Person extends Object {
12478
12644
  async #fetchStream(url, options = {}) {
12479
12645
  const documentLoader = options.documentLoader ?? this._documentLoader ??
12480
12646
  fetchDocumentLoader;
12647
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
12648
+ fetchDocumentLoader;
12481
12649
  const { document } = await documentLoader(url.href);
12482
12650
  try {
12483
- return await Collection.fromJsonLd(document, { documentLoader });
12651
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
12484
12652
  }
12485
12653
  catch (e) {
12486
12654
  if (!(e instanceof TypeError))
@@ -12561,7 +12729,7 @@ export class Person extends Object {
12561
12729
  async toJsonLd(options = {}) {
12562
12730
  options = {
12563
12731
  ...options,
12564
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
12732
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
12565
12733
  };
12566
12734
  // deno-lint-ignore no-unused-vars prefer-const
12567
12735
  let array;
@@ -12672,7 +12840,7 @@ export class Person extends Object {
12672
12840
  if (this.id)
12673
12841
  values["@id"] = this.id.href;
12674
12842
  if (options.expand) {
12675
- return await jsonld.expand(values, options);
12843
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
12676
12844
  }
12677
12845
  return await jsonld.compact(values, [
12678
12846
  "https://www.w3.org/ns/activitystreams",
@@ -12688,7 +12856,7 @@ export class Person extends Object {
12688
12856
  "PropertyValue": "schema:PropertyValue",
12689
12857
  "value": "schema:value",
12690
12858
  },
12691
- ], options);
12859
+ ], { documentLoader: options.contextLoader });
12692
12860
  }
12693
12861
  /**
12694
12862
  * Converts a JSON-LD structure to an object of this type.
@@ -12705,6 +12873,7 @@ export class Person extends Object {
12705
12873
  options = {
12706
12874
  ...options,
12707
12875
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
12876
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
12708
12877
  };
12709
12878
  // deno-lint-ignore no-explicit-any
12710
12879
  let values;
@@ -12713,7 +12882,7 @@ export class Person extends Object {
12713
12882
  }
12714
12883
  else {
12715
12884
  const expanded = await jsonld.expand(json, {
12716
- ...options,
12885
+ documentLoader: options.contextLoader,
12717
12886
  keepFreeFloatingNodes: true,
12718
12887
  });
12719
12888
  values =
@@ -13076,8 +13245,8 @@ export class Place extends Object {
13076
13245
  * @param values The values to initialize the instance with.
13077
13246
  * @param options The options to use for initialization.
13078
13247
  */
13079
- constructor(values, { documentLoader } = {}) {
13080
- super(values, { documentLoader });
13248
+ constructor(values, { documentLoader, contextLoader, } = {}) {
13249
+ super(values, { documentLoader, contextLoader });
13081
13250
  if ("accuracy" in values && values.accuracy != null) {
13082
13251
  this.#_3UCsHnBHvDAXJnBuzw3zw1VVs3Ne = [values.accuracy];
13083
13252
  }
@@ -13188,7 +13357,7 @@ export class Place extends Object {
13188
13357
  async toJsonLd(options = {}) {
13189
13358
  options = {
13190
13359
  ...options,
13191
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
13360
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
13192
13361
  };
13193
13362
  // deno-lint-ignore no-unused-vars prefer-const
13194
13363
  let array;
@@ -13261,9 +13430,9 @@ export class Place extends Object {
13261
13430
  if (this.id)
13262
13431
  values["@id"] = this.id.href;
13263
13432
  if (options.expand) {
13264
- return await jsonld.expand(values, options);
13433
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
13265
13434
  }
13266
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
13435
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
13267
13436
  }
13268
13437
  /**
13269
13438
  * Converts a JSON-LD structure to an object of this type.
@@ -13280,6 +13449,7 @@ export class Place extends Object {
13280
13449
  options = {
13281
13450
  ...options,
13282
13451
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
13452
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
13283
13453
  };
13284
13454
  // deno-lint-ignore no-explicit-any
13285
13455
  let values;
@@ -13288,7 +13458,7 @@ export class Place extends Object {
13288
13458
  }
13289
13459
  else {
13290
13460
  const expanded = await jsonld.expand(json, {
13291
- ...options,
13461
+ documentLoader: options.contextLoader,
13292
13462
  keepFreeFloatingNodes: true,
13293
13463
  });
13294
13464
  values =
@@ -13457,8 +13627,8 @@ export class Profile extends Object {
13457
13627
  * @param values The values to initialize the instance with.
13458
13628
  * @param options The options to use for initialization.
13459
13629
  */
13460
- constructor(values, { documentLoader } = {}) {
13461
- super(values, { documentLoader });
13630
+ constructor(values, { documentLoader, contextLoader, } = {}) {
13631
+ super(values, { documentLoader, contextLoader });
13462
13632
  if ("describes" in values && values.describes != null) {
13463
13633
  this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1 = [values.describes];
13464
13634
  }
@@ -13480,9 +13650,11 @@ export class Profile extends Object {
13480
13650
  async #fetchDescribes(url, options = {}) {
13481
13651
  const documentLoader = options.documentLoader ?? this._documentLoader ??
13482
13652
  fetchDocumentLoader;
13653
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
13654
+ fetchDocumentLoader;
13483
13655
  const { document } = await documentLoader(url.href);
13484
13656
  try {
13485
- return await Object.fromJsonLd(document, { documentLoader });
13657
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
13486
13658
  }
13487
13659
  catch (e) {
13488
13660
  if (!(e instanceof TypeError))
@@ -13525,7 +13697,7 @@ export class Profile extends Object {
13525
13697
  async toJsonLd(options = {}) {
13526
13698
  options = {
13527
13699
  ...options,
13528
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
13700
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
13529
13701
  };
13530
13702
  // deno-lint-ignore no-unused-vars prefer-const
13531
13703
  let array;
@@ -13545,9 +13717,9 @@ export class Profile extends Object {
13545
13717
  if (this.id)
13546
13718
  values["@id"] = this.id.href;
13547
13719
  if (options.expand) {
13548
- return await jsonld.expand(values, options);
13720
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
13549
13721
  }
13550
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
13722
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
13551
13723
  }
13552
13724
  /**
13553
13725
  * Converts a JSON-LD structure to an object of this type.
@@ -13564,6 +13736,7 @@ export class Profile extends Object {
13564
13736
  options = {
13565
13737
  ...options,
13566
13738
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
13739
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
13567
13740
  };
13568
13741
  // deno-lint-ignore no-explicit-any
13569
13742
  let values;
@@ -13572,7 +13745,7 @@ export class Profile extends Object {
13572
13745
  }
13573
13746
  else {
13574
13747
  const expanded = await jsonld.expand(json, {
13575
- ...options,
13748
+ documentLoader: options.contextLoader,
13576
13749
  keepFreeFloatingNodes: true,
13577
13750
  });
13578
13751
  values =
@@ -13641,8 +13814,8 @@ export class Reject extends Activity {
13641
13814
  * @param values The values to initialize the instance with.
13642
13815
  * @param options The options to use for initialization.
13643
13816
  */
13644
- constructor(values, { documentLoader } = {}) {
13645
- super(values, { documentLoader });
13817
+ constructor(values, { documentLoader, contextLoader, } = {}) {
13818
+ super(values, { documentLoader, contextLoader });
13646
13819
  }
13647
13820
  /**
13648
13821
  * Clones this instance, optionally updating it with the given values.
@@ -13661,7 +13834,7 @@ export class Reject extends Activity {
13661
13834
  async toJsonLd(options = {}) {
13662
13835
  options = {
13663
13836
  ...options,
13664
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
13837
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
13665
13838
  };
13666
13839
  // deno-lint-ignore no-unused-vars prefer-const
13667
13840
  let array;
@@ -13674,9 +13847,9 @@ export class Reject extends Activity {
13674
13847
  if (this.id)
13675
13848
  values["@id"] = this.id.href;
13676
13849
  if (options.expand) {
13677
- return await jsonld.expand(values, options);
13850
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
13678
13851
  }
13679
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
13852
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
13680
13853
  }
13681
13854
  /**
13682
13855
  * Converts a JSON-LD structure to an object of this type.
@@ -13693,6 +13866,7 @@ export class Reject extends Activity {
13693
13866
  options = {
13694
13867
  ...options,
13695
13868
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
13869
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
13696
13870
  };
13697
13871
  // deno-lint-ignore no-explicit-any
13698
13872
  let values;
@@ -13701,7 +13875,7 @@ export class Reject extends Activity {
13701
13875
  }
13702
13876
  else {
13703
13877
  const expanded = await jsonld.expand(json, {
13704
- ...options,
13878
+ documentLoader: options.contextLoader,
13705
13879
  keepFreeFloatingNodes: true,
13706
13880
  });
13707
13881
  values =
@@ -13755,8 +13929,8 @@ export class Relationship extends Object {
13755
13929
  * @param values The values to initialize the instance with.
13756
13930
  * @param options The options to use for initialization.
13757
13931
  */
13758
- constructor(values, { documentLoader } = {}) {
13759
- super(values, { documentLoader });
13932
+ constructor(values, { documentLoader, contextLoader, } = {}) {
13933
+ super(values, { documentLoader, contextLoader });
13760
13934
  if ("subject" in values && values.subject != null) {
13761
13935
  this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq = [values.subject];
13762
13936
  }
@@ -13824,9 +13998,11 @@ export class Relationship extends Object {
13824
13998
  async #fetchSubject(url, options = {}) {
13825
13999
  const documentLoader = options.documentLoader ?? this._documentLoader ??
13826
14000
  fetchDocumentLoader;
14001
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14002
+ fetchDocumentLoader;
13827
14003
  const { document } = await documentLoader(url.href);
13828
14004
  try {
13829
- return await Object.fromJsonLd(document, { documentLoader });
14005
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
13830
14006
  }
13831
14007
  catch (e) {
13832
14008
  if (!(e instanceof TypeError))
@@ -13867,9 +14043,11 @@ export class Relationship extends Object {
13867
14043
  async #fetchObject(url, options = {}) {
13868
14044
  const documentLoader = options.documentLoader ?? this._documentLoader ??
13869
14045
  fetchDocumentLoader;
14046
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14047
+ fetchDocumentLoader;
13870
14048
  const { document } = await documentLoader(url.href);
13871
14049
  try {
13872
- return await Object.fromJsonLd(document, { documentLoader });
14050
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
13873
14051
  }
13874
14052
  catch (e) {
13875
14053
  if (!(e instanceof TypeError))
@@ -13930,9 +14108,11 @@ export class Relationship extends Object {
13930
14108
  async #fetchRelationship(url, options = {}) {
13931
14109
  const documentLoader = options.documentLoader ?? this._documentLoader ??
13932
14110
  fetchDocumentLoader;
14111
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14112
+ fetchDocumentLoader;
13933
14113
  const { document } = await documentLoader(url.href);
13934
14114
  try {
13935
- return await Object.fromJsonLd(document, { documentLoader });
14115
+ return await Object.fromJsonLd(document, { documentLoader, contextLoader });
13936
14116
  }
13937
14117
  catch (e) {
13938
14118
  if (!(e instanceof TypeError))
@@ -14001,7 +14181,7 @@ export class Relationship extends Object {
14001
14181
  async toJsonLd(options = {}) {
14002
14182
  options = {
14003
14183
  ...options,
14004
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
14184
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
14005
14185
  };
14006
14186
  // deno-lint-ignore no-unused-vars prefer-const
14007
14187
  let array;
@@ -14035,9 +14215,9 @@ export class Relationship extends Object {
14035
14215
  if (this.id)
14036
14216
  values["@id"] = this.id.href;
14037
14217
  if (options.expand) {
14038
- return await jsonld.expand(values, options);
14218
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
14039
14219
  }
14040
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
14220
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
14041
14221
  }
14042
14222
  /**
14043
14223
  * Converts a JSON-LD structure to an object of this type.
@@ -14054,6 +14234,7 @@ export class Relationship extends Object {
14054
14234
  options = {
14055
14235
  ...options,
14056
14236
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
14237
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
14057
14238
  };
14058
14239
  // deno-lint-ignore no-explicit-any
14059
14240
  let values;
@@ -14062,7 +14243,7 @@ export class Relationship extends Object {
14062
14243
  }
14063
14244
  else {
14064
14245
  const expanded = await jsonld.expand(json, {
14065
- ...options,
14246
+ documentLoader: options.contextLoader,
14066
14247
  keepFreeFloatingNodes: true,
14067
14248
  });
14068
14249
  values =
@@ -14188,8 +14369,8 @@ export class Remove extends Activity {
14188
14369
  * @param values The values to initialize the instance with.
14189
14370
  * @param options The options to use for initialization.
14190
14371
  */
14191
- constructor(values, { documentLoader } = {}) {
14192
- super(values, { documentLoader });
14372
+ constructor(values, { documentLoader, contextLoader, } = {}) {
14373
+ super(values, { documentLoader, contextLoader });
14193
14374
  }
14194
14375
  /**
14195
14376
  * Clones this instance, optionally updating it with the given values.
@@ -14208,7 +14389,7 @@ export class Remove extends Activity {
14208
14389
  async toJsonLd(options = {}) {
14209
14390
  options = {
14210
14391
  ...options,
14211
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
14392
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
14212
14393
  };
14213
14394
  // deno-lint-ignore no-unused-vars prefer-const
14214
14395
  let array;
@@ -14221,9 +14402,9 @@ export class Remove extends Activity {
14221
14402
  if (this.id)
14222
14403
  values["@id"] = this.id.href;
14223
14404
  if (options.expand) {
14224
- return await jsonld.expand(values, options);
14405
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
14225
14406
  }
14226
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
14407
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
14227
14408
  }
14228
14409
  /**
14229
14410
  * Converts a JSON-LD structure to an object of this type.
@@ -14240,6 +14421,7 @@ export class Remove extends Activity {
14240
14421
  options = {
14241
14422
  ...options,
14242
14423
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
14424
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
14243
14425
  };
14244
14426
  // deno-lint-ignore no-explicit-any
14245
14427
  let values;
@@ -14248,7 +14430,7 @@ export class Remove extends Activity {
14248
14430
  }
14249
14431
  else {
14250
14432
  const expanded = await jsonld.expand(json, {
14251
- ...options,
14433
+ documentLoader: options.contextLoader,
14252
14434
  keepFreeFloatingNodes: true,
14253
14435
  });
14254
14436
  values =
@@ -14307,8 +14489,8 @@ export class Service extends Object {
14307
14489
  * @param values The values to initialize the instance with.
14308
14490
  * @param options The options to use for initialization.
14309
14491
  */
14310
- constructor(values, { documentLoader } = {}) {
14311
- super(values, { documentLoader });
14492
+ constructor(values, { documentLoader, contextLoader, } = {}) {
14493
+ super(values, { documentLoader, contextLoader });
14312
14494
  if ("preferredUsername" in values && values.preferredUsername != null) {
14313
14495
  this.#_3isuDgRAKSntq9XdbjiNxjwyPZAf = [values.preferredUsername];
14314
14496
  }
@@ -14469,9 +14651,11 @@ export class Service extends Object {
14469
14651
  async #fetchPublicKey(url, options = {}) {
14470
14652
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14471
14653
  fetchDocumentLoader;
14654
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14655
+ fetchDocumentLoader;
14472
14656
  const { document } = await documentLoader(url.href);
14473
14657
  try {
14474
- return await CryptographicKey.fromJsonLd(document, { documentLoader });
14658
+ return await CryptographicKey.fromJsonLd(document, { documentLoader, contextLoader });
14475
14659
  }
14476
14660
  catch (e) {
14477
14661
  if (!(e instanceof TypeError))
@@ -14544,9 +14728,11 @@ export class Service extends Object {
14544
14728
  async #fetchInbox(url, options = {}) {
14545
14729
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14546
14730
  fetchDocumentLoader;
14731
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14732
+ fetchDocumentLoader;
14547
14733
  const { document } = await documentLoader(url.href);
14548
14734
  try {
14549
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
14735
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
14550
14736
  }
14551
14737
  catch (e) {
14552
14738
  if (!(e instanceof TypeError))
@@ -14596,9 +14782,11 @@ export class Service extends Object {
14596
14782
  async #fetchOutbox(url, options = {}) {
14597
14783
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14598
14784
  fetchDocumentLoader;
14785
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14786
+ fetchDocumentLoader;
14599
14787
  const { document } = await documentLoader(url.href);
14600
14788
  try {
14601
- return await OrderedCollection.fromJsonLd(document, { documentLoader });
14789
+ return await OrderedCollection.fromJsonLd(document, { documentLoader, contextLoader });
14602
14790
  }
14603
14791
  catch (e) {
14604
14792
  if (!(e instanceof TypeError))
@@ -14645,9 +14833,11 @@ export class Service extends Object {
14645
14833
  async #fetchFollowing(url, options = {}) {
14646
14834
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14647
14835
  fetchDocumentLoader;
14836
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14837
+ fetchDocumentLoader;
14648
14838
  const { document } = await documentLoader(url.href);
14649
14839
  try {
14650
- return await Collection.fromJsonLd(document, { documentLoader });
14840
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
14651
14841
  }
14652
14842
  catch (e) {
14653
14843
  if (!(e instanceof TypeError))
@@ -14689,9 +14879,11 @@ export class Service extends Object {
14689
14879
  async #fetchFollowers(url, options = {}) {
14690
14880
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14691
14881
  fetchDocumentLoader;
14882
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14883
+ fetchDocumentLoader;
14692
14884
  const { document } = await documentLoader(url.href);
14693
14885
  try {
14694
- return await Collection.fromJsonLd(document, { documentLoader });
14886
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
14695
14887
  }
14696
14888
  catch (e) {
14697
14889
  if (!(e instanceof TypeError))
@@ -14736,9 +14928,11 @@ export class Service extends Object {
14736
14928
  async #fetchLinked(url, options = {}) {
14737
14929
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14738
14930
  fetchDocumentLoader;
14931
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14932
+ fetchDocumentLoader;
14739
14933
  const { document } = await documentLoader(url.href);
14740
14934
  try {
14741
- return await Collection.fromJsonLd(document, { documentLoader });
14935
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
14742
14936
  }
14743
14937
  catch (e) {
14744
14938
  if (!(e instanceof TypeError))
@@ -14781,9 +14975,11 @@ export class Service extends Object {
14781
14975
  async #fetchStream(url, options = {}) {
14782
14976
  const documentLoader = options.documentLoader ?? this._documentLoader ??
14783
14977
  fetchDocumentLoader;
14978
+ const contextLoader = options.contextLoader ?? this._contextLoader ??
14979
+ fetchDocumentLoader;
14784
14980
  const { document } = await documentLoader(url.href);
14785
14981
  try {
14786
- return await Collection.fromJsonLd(document, { documentLoader });
14982
+ return await Collection.fromJsonLd(document, { documentLoader, contextLoader });
14787
14983
  }
14788
14984
  catch (e) {
14789
14985
  if (!(e instanceof TypeError))
@@ -14864,7 +15060,7 @@ export class Service extends Object {
14864
15060
  async toJsonLd(options = {}) {
14865
15061
  options = {
14866
15062
  ...options,
14867
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
15063
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
14868
15064
  };
14869
15065
  // deno-lint-ignore no-unused-vars prefer-const
14870
15066
  let array;
@@ -14975,7 +15171,7 @@ export class Service extends Object {
14975
15171
  if (this.id)
14976
15172
  values["@id"] = this.id.href;
14977
15173
  if (options.expand) {
14978
- return await jsonld.expand(values, options);
15174
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
14979
15175
  }
14980
15176
  return await jsonld.compact(values, [
14981
15177
  "https://www.w3.org/ns/activitystreams",
@@ -14991,7 +15187,7 @@ export class Service extends Object {
14991
15187
  "PropertyValue": "schema:PropertyValue",
14992
15188
  "value": "schema:value",
14993
15189
  },
14994
- ], options);
15190
+ ], { documentLoader: options.contextLoader });
14995
15191
  }
14996
15192
  /**
14997
15193
  * Converts a JSON-LD structure to an object of this type.
@@ -15008,6 +15204,7 @@ export class Service extends Object {
15008
15204
  options = {
15009
15205
  ...options,
15010
15206
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
15207
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15011
15208
  };
15012
15209
  // deno-lint-ignore no-explicit-any
15013
15210
  let values;
@@ -15016,7 +15213,7 @@ export class Service extends Object {
15016
15213
  }
15017
15214
  else {
15018
15215
  const expanded = await jsonld.expand(json, {
15019
- ...options,
15216
+ documentLoader: options.contextLoader,
15020
15217
  keepFreeFloatingNodes: true,
15021
15218
  });
15022
15219
  values =
@@ -15377,8 +15574,8 @@ export class Undo extends Activity {
15377
15574
  * @param values The values to initialize the instance with.
15378
15575
  * @param options The options to use for initialization.
15379
15576
  */
15380
- constructor(values, { documentLoader } = {}) {
15381
- super(values, { documentLoader });
15577
+ constructor(values, { documentLoader, contextLoader, } = {}) {
15578
+ super(values, { documentLoader, contextLoader });
15382
15579
  }
15383
15580
  /**
15384
15581
  * Clones this instance, optionally updating it with the given values.
@@ -15397,7 +15594,7 @@ export class Undo extends Activity {
15397
15594
  async toJsonLd(options = {}) {
15398
15595
  options = {
15399
15596
  ...options,
15400
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
15597
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15401
15598
  };
15402
15599
  // deno-lint-ignore no-unused-vars prefer-const
15403
15600
  let array;
@@ -15410,9 +15607,9 @@ export class Undo extends Activity {
15410
15607
  if (this.id)
15411
15608
  values["@id"] = this.id.href;
15412
15609
  if (options.expand) {
15413
- return await jsonld.expand(values, options);
15610
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
15414
15611
  }
15415
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
15612
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15416
15613
  }
15417
15614
  /**
15418
15615
  * Converts a JSON-LD structure to an object of this type.
@@ -15429,6 +15626,7 @@ export class Undo extends Activity {
15429
15626
  options = {
15430
15627
  ...options,
15431
15628
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
15629
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15432
15630
  };
15433
15631
  // deno-lint-ignore no-explicit-any
15434
15632
  let values;
@@ -15437,7 +15635,7 @@ export class Undo extends Activity {
15437
15635
  }
15438
15636
  else {
15439
15637
  const expanded = await jsonld.expand(json, {
15440
- ...options,
15638
+ documentLoader: options.contextLoader,
15441
15639
  keepFreeFloatingNodes: true,
15442
15640
  });
15443
15641
  values =
@@ -15486,8 +15684,8 @@ export class Update extends Activity {
15486
15684
  * @param values The values to initialize the instance with.
15487
15685
  * @param options The options to use for initialization.
15488
15686
  */
15489
- constructor(values, { documentLoader } = {}) {
15490
- super(values, { documentLoader });
15687
+ constructor(values, { documentLoader, contextLoader, } = {}) {
15688
+ super(values, { documentLoader, contextLoader });
15491
15689
  }
15492
15690
  /**
15493
15691
  * Clones this instance, optionally updating it with the given values.
@@ -15506,7 +15704,7 @@ export class Update extends Activity {
15506
15704
  async toJsonLd(options = {}) {
15507
15705
  options = {
15508
15706
  ...options,
15509
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
15707
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15510
15708
  };
15511
15709
  // deno-lint-ignore no-unused-vars prefer-const
15512
15710
  let array;
@@ -15519,9 +15717,9 @@ export class Update extends Activity {
15519
15717
  if (this.id)
15520
15718
  values["@id"] = this.id.href;
15521
15719
  if (options.expand) {
15522
- return await jsonld.expand(values, options);
15720
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
15523
15721
  }
15524
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
15722
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15525
15723
  }
15526
15724
  /**
15527
15725
  * Converts a JSON-LD structure to an object of this type.
@@ -15538,6 +15736,7 @@ export class Update extends Activity {
15538
15736
  options = {
15539
15737
  ...options,
15540
15738
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
15739
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15541
15740
  };
15542
15741
  // deno-lint-ignore no-explicit-any
15543
15742
  let values;
@@ -15546,7 +15745,7 @@ export class Update extends Activity {
15546
15745
  }
15547
15746
  else {
15548
15747
  const expanded = await jsonld.expand(json, {
15549
- ...options,
15748
+ documentLoader: options.contextLoader,
15550
15749
  keepFreeFloatingNodes: true,
15551
15750
  });
15552
15751
  values =
@@ -15591,8 +15790,8 @@ export class Video extends Document {
15591
15790
  * @param values The values to initialize the instance with.
15592
15791
  * @param options The options to use for initialization.
15593
15792
  */
15594
- constructor(values, { documentLoader } = {}) {
15595
- super(values, { documentLoader });
15793
+ constructor(values, { documentLoader, contextLoader, } = {}) {
15794
+ super(values, { documentLoader, contextLoader });
15596
15795
  }
15597
15796
  /**
15598
15797
  * Clones this instance, optionally updating it with the given values.
@@ -15611,7 +15810,7 @@ export class Video extends Document {
15611
15810
  async toJsonLd(options = {}) {
15612
15811
  options = {
15613
15812
  ...options,
15614
- documentLoader: options.documentLoader ?? fetchDocumentLoader,
15813
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15615
15814
  };
15616
15815
  // deno-lint-ignore no-unused-vars prefer-const
15617
15816
  let array;
@@ -15624,9 +15823,9 @@ export class Video extends Document {
15624
15823
  if (this.id)
15625
15824
  values["@id"] = this.id.href;
15626
15825
  if (options.expand) {
15627
- return await jsonld.expand(values, options);
15826
+ return await jsonld.expand(values, { documentLoader: options.contextLoader });
15628
15827
  }
15629
- return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", options);
15828
+ return await jsonld.compact(values, "https://www.w3.org/ns/activitystreams", { documentLoader: options.contextLoader });
15630
15829
  }
15631
15830
  /**
15632
15831
  * Converts a JSON-LD structure to an object of this type.
@@ -15643,6 +15842,7 @@ export class Video extends Document {
15643
15842
  options = {
15644
15843
  ...options,
15645
15844
  documentLoader: options.documentLoader ?? fetchDocumentLoader,
15845
+ contextLoader: options.contextLoader ?? fetchDocumentLoader,
15646
15846
  };
15647
15847
  // deno-lint-ignore no-explicit-any
15648
15848
  let values;
@@ -15651,7 +15851,7 @@ export class Video extends Document {
15651
15851
  }
15652
15852
  else {
15653
15853
  const expanded = await jsonld.expand(json, {
15654
- ...options,
15854
+ documentLoader: options.contextLoader,
15655
15855
  keepFreeFloatingNodes: true,
15656
15856
  });
15657
15857
  values =