solid-ui 2.4.25-3d353685 → 2.4.25-f19ac1bc

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.
Files changed (73) hide show
  1. package/dist/main.js +243 -217
  2. package/dist/main.js.map +1 -1
  3. package/lib/acl/access-controller.js.map +1 -1
  4. package/lib/acl/access-groups.js.map +1 -1
  5. package/lib/acl/acl-control.js.map +1 -1
  6. package/lib/acl/acl.js.map +1 -1
  7. package/lib/acl/add-agent-buttons.js.map +1 -1
  8. package/lib/acl/index.js.map +1 -1
  9. package/lib/acl/styles.js.map +1 -1
  10. package/lib/chat/bookmarks.js.map +1 -1
  11. package/lib/chat/chatLogic.js.map +1 -1
  12. package/lib/chat/dateFolder.js.map +1 -1
  13. package/lib/chat/infinite.js.map +1 -1
  14. package/lib/chat/message.js.map +1 -1
  15. package/lib/chat/messageTools.js.map +1 -1
  16. package/lib/chat/thread.js.map +1 -1
  17. package/lib/create/create.js.map +1 -1
  18. package/lib/create/index.js.map +1 -1
  19. package/lib/debug.js.map +1 -1
  20. package/lib/folders.js.map +1 -1
  21. package/lib/footer/index.js.map +1 -1
  22. package/lib/footer/styleMap.js.map +1 -1
  23. package/lib/header/empty-profile.js.map +1 -1
  24. package/lib/header/index.js.map +1 -1
  25. package/lib/header/styleMap.js.map +1 -1
  26. package/lib/iconBase.js.map +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/jss/index.js.map +1 -1
  29. package/lib/log.js +7 -7
  30. package/lib/log.js.map +1 -1
  31. package/lib/login/login.js.map +1 -1
  32. package/lib/matrix/index.js.map +1 -1
  33. package/lib/matrix/matrix.js.map +1 -1
  34. package/lib/media/index.js.map +1 -1
  35. package/lib/media/media-capture.js.map +1 -1
  36. package/lib/messageArea.js.map +1 -1
  37. package/lib/noun_Camera_1618446_000000.js.map +1 -1
  38. package/lib/ns.js.map +1 -1
  39. package/lib/pad.js.map +1 -1
  40. package/lib/participation.js.map +1 -1
  41. package/lib/preferences.js.map +1 -1
  42. package/lib/signup/config-default.js.map +1 -1
  43. package/lib/signup/signup.js.map +1 -1
  44. package/lib/stories/decorators.js.map +1 -1
  45. package/lib/style.js.map +1 -1
  46. package/lib/style_multiSelect.js.map +1 -1
  47. package/lib/table.js.map +1 -1
  48. package/lib/tabs.js.map +1 -1
  49. package/lib/utils/headerFooterHelpers.js.map +1 -1
  50. package/lib/utils/index.js.map +1 -1
  51. package/lib/utils/label.js.map +1 -1
  52. package/lib/versionInfo.js +5 -5
  53. package/lib/versionInfo.js.map +1 -1
  54. package/lib/widgets/buttons/iconLinks.js.map +1 -1
  55. package/lib/widgets/buttons.js.map +1 -1
  56. package/lib/widgets/dragAndDrop.js.map +1 -1
  57. package/lib/widgets/error.js.map +1 -1
  58. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  59. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  60. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  61. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  62. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  63. package/lib/widgets/forms/basic.js.map +1 -1
  64. package/lib/widgets/forms/comment.js.map +1 -1
  65. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  66. package/lib/widgets/forms/fieldParams.js.map +1 -1
  67. package/lib/widgets/forms/formStyle.js.map +1 -1
  68. package/lib/widgets/forms.js.map +1 -1
  69. package/lib/widgets/index.js.map +1 -1
  70. package/lib/widgets/multiSelect.js.map +1 -1
  71. package/lib/widgets/peoplePicker.js.map +1 -1
  72. package/lib/widgets/widgetHelpers.js.map +1 -1
  73. package/package.json +19 -19
package/dist/main.js CHANGED
@@ -6320,13 +6320,13 @@ var LogLevel;
6320
6320
  /** @internal */
6321
6321
  exports.LogLevel = LogLevel;
6322
6322
  (function (LogLevel) {
6323
- LogLevel[LogLevel["Error"] = TERROR] = "Error";
6324
- LogLevel[LogLevel["Warning"] = TWARN] = "Warning";
6325
- LogLevel[LogLevel["Message"] = TMESG] = "Message";
6326
- LogLevel[LogLevel["Success"] = TSUCCESS] = "Success";
6327
- LogLevel[LogLevel["Info"] = TINFO] = "Info";
6328
- LogLevel[LogLevel["Debug"] = TDEBUG] = "Debug";
6329
- LogLevel[LogLevel["All"] = TALL] = "All";
6323
+ LogLevel[LogLevel["Error"] = 1] = "Error";
6324
+ LogLevel[LogLevel["Warning"] = 2] = "Warning";
6325
+ LogLevel[LogLevel["Message"] = 4] = "Message";
6326
+ LogLevel[LogLevel["Success"] = 8] = "Success";
6327
+ LogLevel[LogLevel["Info"] = 16] = "Info";
6328
+ LogLevel[LogLevel["Debug"] = 32] = "Debug";
6329
+ LogLevel[LogLevel["All"] = 63] = "All";
6330
6330
  })(LogLevel || (exports.LogLevel = LogLevel = {}));
6331
6331
  var _level = TERROR + TWARN + TMESG;
6332
6332
  /** @internal */
@@ -13119,12 +13119,12 @@ Object.defineProperty(exports, "__esModule", ({
13119
13119
  }));
13120
13120
  exports.versionInfo = void 0;
13121
13121
  var versionInfo = {
13122
- buildTime: '2023-02-13T18:33:53Z',
13123
- commit: '3d3536854bc96f1a76b3da3788eb578207ead433',
13122
+ buildTime: '2023-02-28T16:24:57Z',
13123
+ commit: 'f19ac1bc672bcd96a6cad46a7101d3761036bd19',
13124
13124
  npmInfo: {
13125
13125
  'solid-ui': '2.4.25',
13126
- npm: '8.19.3',
13127
- node: '16.19.0',
13126
+ npm: '8.19.4',
13127
+ node: '16.19.1',
13128
13128
  v8: '9.4.146.26-node.24',
13129
13129
  uv: '1.43.0',
13130
13130
  zlib: '1.2.11',
@@ -13134,7 +13134,7 @@ var versionInfo = {
13134
13134
  nghttp2: '1.47.0',
13135
13135
  napi: '8',
13136
13136
  llhttp: '6.0.10',
13137
- openssl: '1.1.1s+quic',
13137
+ openssl: '1.1.1t+quic',
13138
13138
  cldr: '41.0',
13139
13139
  icu: '71.1',
13140
13140
  tz: '2022f',
@@ -25646,7 +25646,10 @@ class ClientAuthentication {
25646
25646
  this.login = async (options, eventEmitter) => {
25647
25647
  var _a, _b;
25648
25648
  await this.sessionInfoManager.clear(options.sessionId);
25649
- const redirectUrl = (0, oidc_client_ext_1.removeOidcQueryParam)((_a = options.redirectUrl) !== null && _a !== void 0 ? _a : window.location.href);
25649
+ const redirectUrl = (_a = options.redirectUrl) !== null && _a !== void 0 ? _a : (0, oidc_client_ext_1.removeOidcQueryParam)(window.location.href);
25650
+ if (!(0, solid_client_authn_core_1.isValidRedirectUrl)(redirectUrl)) {
25651
+ throw new Error(`${redirectUrl} is not a valid redirect URL, it is either a malformed IRI or it includes a hash fragment.`);
25652
+ }
25650
25653
  await this.loginHandler.handle({
25651
25654
  ...options,
25652
25655
  redirectUrl,
@@ -26117,7 +26120,6 @@ exports["default"] = ClientRegistrar;
26117
26120
  Object.defineProperty(exports, "__esModule", ({ value: true }));
26118
26121
  exports.WELL_KNOWN_OPENID_CONFIG = void 0;
26119
26122
  const solid_client_authn_core_1 = __webpack_require__(/*! @inrupt/solid-client-authn-core */ "./node_modules/@inrupt/solid-client-authn-core/dist/index.js");
26120
- const urlPath_1 = __webpack_require__(/*! ../../util/urlPath */ "./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js");
26121
26123
  exports.WELL_KNOWN_OPENID_CONFIG = ".well-known/openid-configuration";
26122
26124
  const issuerConfigKeyMap = {
26123
26125
  issuer: {
@@ -26223,7 +26225,7 @@ class IssuerConfigFetcher {
26223
26225
  }
26224
26226
  async fetchConfig(issuer) {
26225
26227
  let issuerConfig;
26226
- const openIdConfigUrl = (0, urlPath_1.appendToUrlPathname)(issuer, exports.WELL_KNOWN_OPENID_CONFIG);
26228
+ const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer).href;
26227
26229
  const issuerConfigRequestBody = await window.fetch(openIdConfigUrl);
26228
26230
  try {
26229
26231
  issuerConfig = processConfig(await issuerConfigRequestBody.json());
@@ -26774,27 +26776,6 @@ exports["default"] = StorageUtilityBrowser;
26774
26776
 
26775
26777
  /***/ }),
26776
26778
 
26777
- /***/ "./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js":
26778
- /*!******************************************************************************!*\
26779
- !*** ./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js ***!
26780
- \******************************************************************************/
26781
- /***/ ((__unused_webpack_module, exports) => {
26782
-
26783
- "use strict";
26784
-
26785
- Object.defineProperty(exports, "__esModule", ({ value: true }));
26786
- exports.appendToUrlPathname = void 0;
26787
- function appendToUrlPathname(url, append) {
26788
- const parsedUrl = new URL(url);
26789
- const path = parsedUrl.pathname;
26790
- parsedUrl.pathname = `${path}${path.endsWith("/") ? "" : "/"}${append.startsWith("/") ? append.substring(1) : append}`;
26791
- return parsedUrl.toString();
26792
- }
26793
- exports.appendToUrlPathname = appendToUrlPathname;
26794
- //# sourceMappingURL=urlPath.js.map
26795
-
26796
- /***/ }),
26797
-
26798
26779
  /***/ "./node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/commonjs-browser/index.js":
26799
26780
  /*!**********************************************************************************************************!*\
26800
26781
  !*** ./node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/commonjs-browser/index.js ***!
@@ -27909,6 +27890,16 @@ async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
27909
27890
  }
27910
27891
  }
27911
27892
 
27893
+ function isValidRedirectUrl(redirectUrl) {
27894
+ try {
27895
+ const urlObject = new URL(redirectUrl);
27896
+ return urlObject.hash === "";
27897
+ }
27898
+ catch (e) {
27899
+ return false;
27900
+ }
27901
+ }
27902
+
27912
27903
  function isSupportedTokenType(token) {
27913
27904
  return typeof token === "string" && ["DPoP", "Bearer"].includes(token);
27914
27905
  }
@@ -28324,6 +28315,7 @@ exports.getSessionIdFromOauthState = getSessionIdFromOauthState;
28324
28315
  exports.getWebidFromTokenPayload = getWebidFromTokenPayload;
28325
28316
  exports.handleRegistration = handleRegistration;
28326
28317
  exports.isSupportedTokenType = isSupportedTokenType;
28318
+ exports.isValidRedirectUrl = isValidRedirectUrl;
28327
28319
  exports.loadOidcContextFromStorage = loadOidcContextFromStorage;
28328
28320
  exports.mockStorage = mockStorage;
28329
28321
  exports.mockStorageUtility = mockStorageUtility;
@@ -45275,7 +45267,7 @@ function () {
45275
45267
 
45276
45268
  return ConditionalRule;
45277
45269
  }();
45278
- var keyRegExp = /@media|@supports\s+/;
45270
+ var keyRegExp = /@container|@media|@supports\s+/;
45279
45271
  var pluginConditionalRule = {
45280
45272
  onCreateRule: function onCreateRule(key, styles, options) {
45281
45273
  return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;
@@ -46839,7 +46831,7 @@ var Jss =
46839
46831
  function () {
46840
46832
  function Jss(options) {
46841
46833
  this.id = instanceCounter++;
46842
- this.version = "10.9.2";
46834
+ this.version = "10.10.0";
46843
46835
  this.plugins = new PluginsRegistry();
46844
46836
  this.options = {
46845
46837
  id: {
@@ -54280,16 +54272,17 @@ var Fetcher = /*#__PURE__*/function () {
54280
54272
  var fetcher = this;
54281
54273
  // @ts-ignore
54282
54274
  if (fetcher.fetchQueue && fetcher.fetchQueue[uri]) {
54283
- console.log('Internal error - fetchQueue exists ' + uri);
54275
+ // console.log('Internal error - fetchQueue exists ' + uri)
54284
54276
  var promise = fetcher.fetchQueue[uri];
54285
54277
  if (promise['PromiseStatus'] === 'resolved') {
54286
54278
  delete fetcher.fetchQueue[uri];
54287
54279
  } else {
54288
54280
  // pending
54289
54281
  delete fetcher.fetchQueue[uri];
54290
- console.log('*** Fetcher: pending fetchQueue deleted ' + uri);
54282
+ // console.log('*** Fetcher: pending fetchQueue deleted ' + uri)
54291
54283
  }
54292
54284
  }
54285
+
54293
54286
  if (fetcher.requested[uri] && fetcher.requested[uri] !== 'done' && fetcher.requested[uri] !== 'failed' && fetcher.requested[uri] !== 404) {
54294
54287
  var msg = "Rdflib: fetcher: Destructive operation on <".concat(fetcher.requested[uri], "> file being fetched! ") + uri;
54295
54288
  console.error(msg);
@@ -61241,7 +61234,7 @@ contentType, callback, options) {
61241
61234
  documentString = sz.statementsToNTriples(newSts);
61242
61235
  return executeCallback(null, documentString);
61243
61236
  case _types__WEBPACK_IMPORTED_MODULE_0__.JSONLDContentType:
61244
- sz.setFlags('si'); // use turtle parameters
61237
+ sz.setFlags('si dr'); // turtle + dr (means no default, no relative prefix)
61245
61238
  documentString = sz.statementsToJsonld(newSts); // convert via turtle
61246
61239
  return executeCallback(null, documentString);
61247
61240
  case _types__WEBPACK_IMPORTED_MODULE_0__.NQuadsContentType:
@@ -61313,7 +61306,6 @@ __webpack_require__.r(__webpack_exports__);
61313
61306
 
61314
61307
 
61315
61308
 
61316
- // import * as jsonld from 'jsonld'
61317
61309
 
61318
61310
  function createSerializer(store) {
61319
61311
  return new Serializer(store);
@@ -61820,7 +61812,7 @@ var Serializer = /*#__PURE__*/function () {
61820
61812
  var termToN3 = termToN3Method.bind(this);
61821
61813
  function prefixDirectivesMethod() {
61822
61814
  var str = '';
61823
- if (this.defaultNamespace) {
61815
+ if (this.flags.indexOf('d') < 0 && this.defaultNamespace) {
61824
61816
  str += '@prefix : ' + this.explicitURI(this.defaultNamespace) + '.\n';
61825
61817
  }
61826
61818
  for (var ns in this.prefixes) {
@@ -62305,20 +62297,19 @@ var Serializer = /*#__PURE__*/function () {
62305
62297
  key: "statementsToJsonld",
62306
62298
  value: function statementsToJsonld(sts) {
62307
62299
  // ttl2jsonld creates context keys for all ttl prefix
62308
- // context keys must be full IRI
62309
- function findId(itemObj) {
62300
+ // context keys must be absolute IRI ttl2jsonld@0.0.8
62301
+ /* function findId (itemObj) {
62310
62302
  if (itemObj['@id']) {
62311
- var item = itemObj['@id'].split(':');
62312
- if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1];
62313
- }
62314
- var itemValues = Object.values(itemObj);
62315
- for (var i in itemValues) {
62316
- if (typeof itemValues[i] !== 'string') {
62317
- // @list contains array
62318
- findId(itemValues[i]);
62303
+ const item = itemObj['@id'].split(':')
62304
+ if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1]
62305
+ }
62306
+ const itemValues = Object.values(itemObj)
62307
+ for (const i in itemValues) {
62308
+ if (typeof itemValues[i] !== 'string') { // @list contains array
62309
+ findId(itemValues[i])
62319
62310
  }
62320
62311
  }
62321
- }
62312
+ } */
62322
62313
  var turtleDoc = this.statementsToN3(sts);
62323
62314
  var jsonldObj = _frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_4__.parse(turtleDoc);
62324
62315
  return JSON.stringify(jsonldObj, null, 2);
@@ -66820,15 +66811,13 @@ function createAclLogic(store) {
66820
66811
  var ns = ns_1.ns;
66821
66812
  function findAclDocUrl(url) {
66822
66813
  return __awaiter(this, void 0, void 0, function () {
66823
- var doc, docNode;
66814
+ var docNode;
66824
66815
  return __generator(this, function (_a) {
66825
66816
  switch (_a.label) {
66826
- case 0:
66827
- doc = store.sym(url);
66828
- return [4 /*yield*/, store.fetcher.load(doc)];
66817
+ case 0: return [4 /*yield*/, store.fetcher.load(url)];
66829
66818
  case 1:
66830
66819
  _a.sent();
66831
- docNode = store.any(doc, exports.ACL_LINK);
66820
+ docNode = store.any(url, exports.ACL_LINK);
66832
66821
  if (!docNode) {
66833
66822
  throw new Error("No ACL link discovered for ".concat(url));
66834
66823
  }
@@ -67636,7 +67625,7 @@ function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, acl
67636
67625
  case 2: return [4 /*yield*/, profileLogic.getMainInbox(user)];
67637
67626
  case 3:
67638
67627
  inbox = _a.sent();
67639
- return [4 /*yield*/, containerLogic.getContainerMembers(inbox.value)];
67628
+ return [4 /*yield*/, containerLogic.getContainerMembers(inbox)];
67640
67629
  case 4:
67641
67630
  urls = _a.sent();
67642
67631
  return [2 /*return*/, urls.filter(function (url) { return !containerLogic.isContainer(url); })];
@@ -68792,19 +68781,21 @@ var rdflib_1 = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/inde
68792
68781
  function createContainerLogic(store) {
68793
68782
  function getContainerElements(containerNode) {
68794
68783
  return store
68795
- .statementsMatching(containerNode, (0, rdflib_1.sym)("http://www.w3.org/ns/ldp#contains"), undefined, containerNode.doc())
68784
+ .statementsMatching(containerNode, (0, rdflib_1.sym)("http://www.w3.org/ns/ldp#contains"), undefined)
68796
68785
  .map(function (st) { return st.object; });
68797
68786
  }
68798
68787
  function isContainer(url) {
68799
- return url.charAt(url.length - 1) === "/";
68788
+ var nodeToString = url.value;
68789
+ return nodeToString.charAt(nodeToString.length - 1) === "/";
68800
68790
  }
68801
68791
  function createContainer(url) {
68802
68792
  return __awaiter(this, void 0, void 0, function () {
68803
- var result;
68793
+ var stringToNode, result;
68804
68794
  return __generator(this, function (_a) {
68805
68795
  switch (_a.label) {
68806
68796
  case 0:
68807
- if (!isContainer(url)) {
68797
+ stringToNode = (0, rdflib_1.sym)(url);
68798
+ if (!isContainer(stringToNode)) {
68808
68799
  throw new Error("Not a container URL ".concat(url));
68809
68800
  }
68810
68801
  return [4 /*yield*/, store.fetcher._fetch(url, {
@@ -68828,16 +68819,12 @@ function createContainerLogic(store) {
68828
68819
  }
68829
68820
  function getContainerMembers(containerUrl) {
68830
68821
  return __awaiter(this, void 0, void 0, function () {
68831
- var containerNode, nodes;
68832
68822
  return __generator(this, function (_a) {
68833
68823
  switch (_a.label) {
68834
- case 0:
68835
- containerNode = store.sym(containerUrl);
68836
- return [4 /*yield*/, store.fetcher.load(containerNode)];
68824
+ case 0: return [4 /*yield*/, store.fetcher.load(containerUrl)];
68837
68825
  case 1:
68838
68826
  _a.sent();
68839
- nodes = getContainerElements(containerNode);
68840
- return [2 /*return*/, nodes.map(function (node) { return node.value; })];
68827
+ return [2 /*return*/, getContainerElements(containerUrl)];
68841
68828
  }
68842
68829
  });
68843
68830
  });
@@ -69023,28 +69010,30 @@ var CustomError_1 = __webpack_require__(/*! ../logic/CustomError */ "./node_modu
69023
69010
  var debug = __importStar(__webpack_require__(/*! ../util/debug */ "./node_modules/solid-logic/lib/util/debug.js"));
69024
69011
  var utils_1 = __webpack_require__(/*! ./utils */ "./node_modules/solid-logic/lib/util/utils.js");
69025
69012
  function createUtilityLogic(store, aclLogic, containerLogic) {
69026
- function recursiveDelete(url) {
69013
+ function recursiveDelete(containerNode) {
69027
69014
  return __awaiter(this, void 0, void 0, function () {
69028
- var aclDocUrl, containerMembers, e_1;
69015
+ var aclDocUrl, containerMembers, nodeToStringHere, e_1;
69029
69016
  return __generator(this, function (_a) {
69030
69017
  switch (_a.label) {
69031
69018
  case 0:
69032
69019
  _a.trys.push([0, 6, , 7]);
69033
- if (!containerLogic.isContainer(url)) return [3 /*break*/, 5];
69034
- return [4 /*yield*/, aclLogic.findAclDocUrl(url)];
69020
+ if (!containerLogic.isContainer(containerNode)) return [3 /*break*/, 5];
69021
+ return [4 /*yield*/, aclLogic.findAclDocUrl(containerNode)];
69035
69022
  case 1:
69036
69023
  aclDocUrl = _a.sent();
69037
69024
  return [4 /*yield*/, store.fetcher._fetch(aclDocUrl, { method: "DELETE" })];
69038
69025
  case 2:
69039
69026
  _a.sent();
69040
- return [4 /*yield*/, containerLogic.getContainerMembers(url)];
69027
+ return [4 /*yield*/, containerLogic.getContainerMembers(containerNode)];
69041
69028
  case 3:
69042
69029
  containerMembers = _a.sent();
69043
69030
  return [4 /*yield*/, Promise.all(containerMembers.map(function (url) { return recursiveDelete(url); }))];
69044
69031
  case 4:
69045
69032
  _a.sent();
69046
69033
  _a.label = 5;
69047
- case 5: return [2 /*return*/, store.fetcher._fetch(url, { method: "DELETE" })];
69034
+ case 5:
69035
+ nodeToStringHere = containerNode.value;
69036
+ return [2 /*return*/, store.fetcher._fetch(nodeToStringHere, { method: "DELETE" })];
69048
69037
  case 6:
69049
69038
  e_1 = _a.sent();
69050
69039
  return [3 /*break*/, 7];
@@ -69189,7 +69178,7 @@ function createUtilityLogic(store, aclLogic, containerLogic) {
69189
69178
  ''
69190
69179
  ].join('\n');
69191
69180
  }
69192
- return [4 /*yield*/, aclLogic.findAclDocUrl(options.target)];
69181
+ return [4 /*yield*/, aclLogic.findAclDocUrl((0, rdflib_1.sym)(options.target))];
69193
69182
  case 1:
69194
69183
  aclDocUrl = _a.sent();
69195
69184
  return [2 /*return*/, store.fetcher._fetch(aclDocUrl, {
@@ -73561,6 +73550,7 @@ __webpack_require__.r(__webpack_exports__);
73561
73550
  /* harmony export */ "getWebidFromTokenPayload": () => (/* binding */ getWebidFromTokenPayload),
73562
73551
  /* harmony export */ "handleRegistration": () => (/* binding */ handleRegistration),
73563
73552
  /* harmony export */ "isSupportedTokenType": () => (/* binding */ isSupportedTokenType),
73553
+ /* harmony export */ "isValidRedirectUrl": () => (/* binding */ isValidRedirectUrl),
73564
73554
  /* harmony export */ "loadOidcContextFromStorage": () => (/* binding */ loadOidcContextFromStorage),
73565
73555
  /* harmony export */ "mockStorage": () => (/* binding */ mockStorage),
73566
73556
  /* harmony export */ "mockStorageUtility": () => (/* binding */ mockStorageUtility),
@@ -73667,6 +73657,16 @@ async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
73667
73657
  }
73668
73658
  }
73669
73659
 
73660
+ function isValidRedirectUrl(redirectUrl) {
73661
+ try {
73662
+ const urlObject = new URL(redirectUrl);
73663
+ return urlObject.hash === "";
73664
+ }
73665
+ catch (e) {
73666
+ return false;
73667
+ }
73668
+ }
73669
+
73670
73670
  function isSupportedTokenType(token) {
73671
73671
  return typeof token === "string" && ["DPoP", "Bearer"].includes(token);
73672
73672
  }
@@ -74891,7 +74891,7 @@ __webpack_require__.r(__webpack_exports__);
74891
74891
  async function EmbeddedJWK(protectedHeader, token) {
74892
74892
  const joseHeader = {
74893
74893
  ...protectedHeader,
74894
- ...token.header,
74894
+ ...token === null || token === void 0 ? void 0 : token.header,
74895
74895
  };
74896
74896
  if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_1__["default"])(joseHeader.jwk)) {
74897
74897
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');
@@ -75036,7 +75036,7 @@ class LocalJWKSet {
75036
75036
  this._jwks = clone(jwks);
75037
75037
  }
75038
75038
  async getKey(protectedHeader, token) {
75039
- const { alg, kid } = { ...protectedHeader, ...token.header };
75039
+ const { alg, kid } = { ...protectedHeader, ...token === null || token === void 0 ? void 0 : token.header };
75040
75040
  const kty = getKtyFromAlg(alg);
75041
75041
  const candidates = this._jwks.keys.filter((jwk) => {
75042
75042
  let candidate = kty === jwk.kty;
@@ -75078,21 +75078,39 @@ class LocalJWKSet {
75078
75078
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSNoMatchingKey();
75079
75079
  }
75080
75080
  else if (length !== 1) {
75081
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSMultipleMatchingKeys();
75081
+ const error = new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSMultipleMatchingKeys();
75082
+ const { _cached } = this;
75083
+ error[Symbol.asyncIterator] = async function* () {
75084
+ for (const jwk of candidates) {
75085
+ try {
75086
+ yield await importWithAlgCache(_cached, jwk, alg);
75087
+ }
75088
+ catch (_a) {
75089
+ continue;
75090
+ }
75091
+ }
75092
+ };
75093
+ throw error;
75082
75094
  }
75083
- const cached = this._cached.get(jwk) || this._cached.set(jwk, {}).get(jwk);
75084
- if (cached[alg] === undefined) {
75085
- const keyObject = await (0,_key_import_js__WEBPACK_IMPORTED_MODULE_0__.importJWK)({ ...jwk, ext: true }, alg);
75086
- if (keyObject instanceof Uint8Array || keyObject.type !== 'public') {
75087
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set members must be public keys');
75088
- }
75089
- cached[alg] = keyObject;
75095
+ return importWithAlgCache(this._cached, jwk, alg);
75096
+ }
75097
+ }
75098
+ async function importWithAlgCache(cache, jwk, alg) {
75099
+ const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk);
75100
+ if (cached[alg] === undefined) {
75101
+ const key = await (0,_key_import_js__WEBPACK_IMPORTED_MODULE_0__.importJWK)({ ...jwk, ext: true }, alg);
75102
+ if (key instanceof Uint8Array || key.type !== 'public') {
75103
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set members must be public keys');
75090
75104
  }
75091
- return cached[alg];
75105
+ cached[alg] = key;
75092
75106
  }
75107
+ return cached[alg];
75093
75108
  }
75094
75109
  function createLocalJWKSet(jwks) {
75095
- return LocalJWKSet.prototype.getKey.bind(new LocalJWKSet(jwks));
75110
+ const set = new LocalJWKSet(jwks);
75111
+ return async function (protectedHeader, token) {
75112
+ return set.getKey(protectedHeader, token);
75113
+ };
75096
75114
  }
75097
75115
 
75098
75116
 
@@ -75192,7 +75210,10 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
75192
75210
  }
75193
75211
  }
75194
75212
  function createRemoteJWKSet(url, options) {
75195
- return RemoteJWKSet.prototype.getKey.bind(new RemoteJWKSet(url, options));
75213
+ const set = new RemoteJWKSet(url, options);
75214
+ return async function (protectedHeader, token) {
75215
+ return set.getKey(protectedHeader, token);
75216
+ };
75196
75217
  }
75197
75218
 
75198
75219
 
@@ -76041,83 +76062,12 @@ __webpack_require__.r(__webpack_exports__);
76041
76062
  /* harmony import */ var _runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../runtime/asn1.js */ "./node_modules/jose/dist/browser/runtime/asn1.js");
76042
76063
  /* harmony import */ var _runtime_jwk_to_key_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../runtime/jwk_to_key.js */ "./node_modules/jose/dist/browser/runtime/jwk_to_key.js");
76043
76064
  /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
76044
- /* harmony import */ var _lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/format_pem.js */ "./node_modules/jose/dist/browser/lib/format_pem.js");
76045
- /* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
76046
-
76047
-
76065
+ /* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
76048
76066
 
76049
76067
 
76050
76068
 
76051
76069
 
76052
76070
 
76053
- function getElement(seq) {
76054
- let result = [];
76055
- let next = 0;
76056
- while (next < seq.length) {
76057
- let nextPart = parseElement(seq.subarray(next));
76058
- result.push(nextPart);
76059
- next += nextPart.byteLength;
76060
- }
76061
- return result;
76062
- }
76063
- function parseElement(bytes) {
76064
- let position = 0;
76065
- let tag = bytes[0] & 0x1f;
76066
- position++;
76067
- if (tag === 0x1f) {
76068
- tag = 0;
76069
- while (bytes[position] >= 0x80) {
76070
- tag = tag * 128 + bytes[position] - 0x80;
76071
- position++;
76072
- }
76073
- tag = tag * 128 + bytes[position] - 0x80;
76074
- position++;
76075
- }
76076
- let length = 0;
76077
- if (bytes[position] < 0x80) {
76078
- length = bytes[position];
76079
- position++;
76080
- }
76081
- else if (length === 0x80) {
76082
- length = 0;
76083
- while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
76084
- if (length > bytes.byteLength) {
76085
- throw new TypeError('invalid indefinite form length');
76086
- }
76087
- length++;
76088
- }
76089
- const byteLength = position + length + 2;
76090
- return {
76091
- byteLength,
76092
- contents: bytes.subarray(position, position + length),
76093
- raw: bytes.subarray(0, byteLength),
76094
- };
76095
- }
76096
- else {
76097
- let numberOfDigits = bytes[position] & 0x7f;
76098
- position++;
76099
- length = 0;
76100
- for (let i = 0; i < numberOfDigits; i++) {
76101
- length = length * 256 + bytes[position];
76102
- position++;
76103
- }
76104
- }
76105
- const byteLength = position + length;
76106
- return {
76107
- byteLength,
76108
- contents: bytes.subarray(position, byteLength),
76109
- raw: bytes.subarray(0, byteLength),
76110
- };
76111
- }
76112
- function spkiFromX509(buf) {
76113
- const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
76114
- return (0,_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
76115
- }
76116
- function getSPKI(x509) {
76117
- const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
76118
- const raw = (0,_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__.decodeBase64)(pem);
76119
- return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
76120
- }
76121
76071
  async function importSPKI(spki, alg, options) {
76122
76072
  if (typeof spki !== 'string' || spki.indexOf('-----BEGIN PUBLIC KEY-----') !== 0) {
76123
76073
  throw new TypeError('"spki" must be SPKI formatted string');
@@ -76128,14 +76078,7 @@ async function importX509(x509, alg, options) {
76128
76078
  if (typeof x509 !== 'string' || x509.indexOf('-----BEGIN CERTIFICATE-----') !== 0) {
76129
76079
  throw new TypeError('"x509" must be X.509 formatted string');
76130
76080
  }
76131
- let spki;
76132
- try {
76133
- spki = getSPKI(x509);
76134
- }
76135
- catch (cause) {
76136
- throw new TypeError('failed to parse the X.509 certificate', { cause });
76137
- }
76138
- return (0,_runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__.fromSPKI)(spki, alg, options);
76081
+ return (0,_runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__.fromX509)(x509, alg, options);
76139
76082
  }
76140
76083
  async function importPKCS8(pkcs8, alg, options) {
76141
76084
  if (typeof pkcs8 !== 'string' || pkcs8.indexOf('-----BEGIN PRIVATE KEY-----') !== 0) {
@@ -76145,13 +76088,10 @@ async function importPKCS8(pkcs8, alg, options) {
76145
76088
  }
76146
76089
  async function importJWK(jwk, alg, octAsKeyObject) {
76147
76090
  var _a;
76148
- if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_5__["default"])(jwk)) {
76091
+ if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_4__["default"])(jwk)) {
76149
76092
  throw new TypeError('JWK must be an object');
76150
76093
  }
76151
76094
  alg || (alg = jwk.alg);
76152
- if (typeof alg !== 'string' || !alg) {
76153
- throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
76154
- }
76155
76095
  switch (jwk.kty) {
76156
76096
  case 'oct':
76157
76097
  if (typeof jwk.k !== 'string' || !jwk.k) {
@@ -76518,13 +76458,13 @@ function checkSigCryptoKey(key, alg, ...usages) {
76518
76458
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
76519
76459
  break;
76520
76460
  }
76521
- case (0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA': {
76522
- if (!isAlgorithm(key.algorithm, 'NODE-ED25519'))
76523
- throw unusable('NODE-ED25519');
76524
- break;
76525
- }
76526
76461
  case 'EdDSA': {
76527
76462
  if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') {
76463
+ if ((0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
76464
+ if (isAlgorithm(key.algorithm, 'NODE-ED25519'))
76465
+ break;
76466
+ throw unusable('Ed25519, Ed448, or NODE-ED25519');
76467
+ }
76528
76468
  throw unusable('Ed25519 or Ed448');
76529
76469
  }
76530
76470
  break;
@@ -77340,6 +77280,7 @@ __webpack_require__.r(__webpack_exports__);
77340
77280
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
77341
77281
  /* harmony export */ "fromPKCS8": () => (/* binding */ fromPKCS8),
77342
77282
  /* harmony export */ "fromSPKI": () => (/* binding */ fromSPKI),
77283
+ /* harmony export */ "fromX509": () => (/* binding */ fromX509),
77343
77284
  /* harmony export */ "toPKCS8": () => (/* binding */ toPKCS8),
77344
77285
  /* harmony export */ "toSPKI": () => (/* binding */ toSPKI)
77345
77286
  /* harmony export */ });
@@ -77409,7 +77350,7 @@ const getNamedCurve = (keyData) => {
77409
77350
  }
77410
77351
  };
77411
77352
  const genericImport = async (replace, keyFormat, pem, alg, options) => {
77412
- var _a;
77353
+ var _a, _b;
77413
77354
  let algorithm;
77414
77355
  let keyUsages;
77415
77356
  const keyData = new Uint8Array(atob(pem.replace(replace, ''))
@@ -77460,12 +77401,6 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
77460
77401
  keyUsages = isPublic ? [] : ['deriveBits'];
77461
77402
  break;
77462
77403
  }
77463
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA': {
77464
- const namedCurve = getNamedCurve(keyData).toUpperCase();
77465
- algorithm = { name: `NODE-${namedCurve}`, namedCurve: `NODE-${namedCurve}` };
77466
- keyUsages = isPublic ? ['verify'] : ['sign'];
77467
- break;
77468
- }
77469
77404
  case 'EdDSA':
77470
77405
  algorithm = { name: getNamedCurve(keyData) };
77471
77406
  keyUsages = isPublic ? ['verify'] : ['sign'];
@@ -77473,7 +77408,18 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
77473
77408
  default:
77474
77409
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__.JOSENotSupported('Invalid or unsupported "alg" (Algorithm) value');
77475
77410
  }
77476
- return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
77411
+ try {
77412
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
77413
+ }
77414
+ catch (err) {
77415
+ if (algorithm.name === 'Ed25519' &&
77416
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
77417
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
77418
+ algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
77419
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_b = options === null || options === void 0 ? void 0 : options.extractable) !== null && _b !== void 0 ? _b : false, keyUsages);
77420
+ }
77421
+ throw err;
77422
+ }
77477
77423
  };
77478
77424
  const fromPKCS8 = (pem, alg, options) => {
77479
77425
  return genericImport(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g, 'pkcs8', pem, alg, options);
@@ -77481,6 +77427,84 @@ const fromPKCS8 = (pem, alg, options) => {
77481
77427
  const fromSPKI = (pem, alg, options) => {
77482
77428
  return genericImport(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, 'spki', pem, alg, options);
77483
77429
  };
77430
+ function getElement(seq) {
77431
+ let result = [];
77432
+ let next = 0;
77433
+ while (next < seq.length) {
77434
+ let nextPart = parseElement(seq.subarray(next));
77435
+ result.push(nextPart);
77436
+ next += nextPart.byteLength;
77437
+ }
77438
+ return result;
77439
+ }
77440
+ function parseElement(bytes) {
77441
+ let position = 0;
77442
+ let tag = bytes[0] & 0x1f;
77443
+ position++;
77444
+ if (tag === 0x1f) {
77445
+ tag = 0;
77446
+ while (bytes[position] >= 0x80) {
77447
+ tag = tag * 128 + bytes[position] - 0x80;
77448
+ position++;
77449
+ }
77450
+ tag = tag * 128 + bytes[position] - 0x80;
77451
+ position++;
77452
+ }
77453
+ let length = 0;
77454
+ if (bytes[position] < 0x80) {
77455
+ length = bytes[position];
77456
+ position++;
77457
+ }
77458
+ else if (length === 0x80) {
77459
+ length = 0;
77460
+ while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
77461
+ if (length > bytes.byteLength) {
77462
+ throw new TypeError('invalid indefinite form length');
77463
+ }
77464
+ length++;
77465
+ }
77466
+ const byteLength = position + length + 2;
77467
+ return {
77468
+ byteLength,
77469
+ contents: bytes.subarray(position, position + length),
77470
+ raw: bytes.subarray(0, byteLength),
77471
+ };
77472
+ }
77473
+ else {
77474
+ let numberOfDigits = bytes[position] & 0x7f;
77475
+ position++;
77476
+ length = 0;
77477
+ for (let i = 0; i < numberOfDigits; i++) {
77478
+ length = length * 256 + bytes[position];
77479
+ position++;
77480
+ }
77481
+ }
77482
+ const byteLength = position + length;
77483
+ return {
77484
+ byteLength,
77485
+ contents: bytes.subarray(position, byteLength),
77486
+ raw: bytes.subarray(0, byteLength),
77487
+ };
77488
+ }
77489
+ function spkiFromX509(buf) {
77490
+ const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
77491
+ return (0,_base64url_js__WEBPACK_IMPORTED_MODULE_3__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
77492
+ }
77493
+ function getSPKI(x509) {
77494
+ const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
77495
+ const raw = (0,_base64url_js__WEBPACK_IMPORTED_MODULE_3__.decodeBase64)(pem);
77496
+ return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
77497
+ }
77498
+ const fromX509 = (pem, alg, options) => {
77499
+ let spki;
77500
+ try {
77501
+ spki = getSPKI(pem);
77502
+ }
77503
+ catch (cause) {
77504
+ throw new TypeError('failed to parse the X.509 certificate', { cause });
77505
+ }
77506
+ return fromSPKI(spki, alg, options);
77507
+ };
77484
77508
 
77485
77509
 
77486
77510
  /***/ }),
@@ -78038,7 +78062,7 @@ function getModulusLengthOption(options) {
78038
78062
  return modulusLength;
78039
78063
  }
78040
78064
  async function generateKeyPair(alg, options) {
78041
- var _a, _b, _c;
78065
+ var _a, _b, _c, _d;
78042
78066
  let algorithm;
78043
78067
  let keyUsages;
78044
78068
  switch (alg) {
@@ -78088,17 +78112,6 @@ async function generateKeyPair(alg, options) {
78088
78112
  algorithm = { name: 'ECDSA', namedCurve: 'P-521' };
78089
78113
  keyUsages = ['sign', 'verify'];
78090
78114
  break;
78091
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA':
78092
- switch (options === null || options === void 0 ? void 0 : options.crv) {
78093
- case undefined:
78094
- case 'Ed25519':
78095
- algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78096
- keyUsages = ['sign', 'verify'];
78097
- break;
78098
- default:
78099
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported crv option provided');
78100
- }
78101
- break;
78102
78115
  case 'EdDSA':
78103
78116
  keyUsages = ['sign', 'verify'];
78104
78117
  const crv = (_a = options === null || options === void 0 ? void 0 : options.crv) !== null && _a !== void 0 ? _a : 'Ed25519';
@@ -78136,7 +78149,18 @@ async function generateKeyPair(alg, options) {
78136
78149
  default:
78137
78150
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78138
78151
  }
78139
- return (_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages));
78152
+ try {
78153
+ return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages));
78154
+ }
78155
+ catch (err) {
78156
+ if (algorithm.name === 'Ed25519' &&
78157
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
78158
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
78159
+ algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78160
+ return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_d = options === null || options === void 0 ? void 0 : options.extractable) !== null && _d !== void 0 ? _d : false, keyUsages));
78161
+ }
78162
+ throw err;
78163
+ }
78140
78164
  }
78141
78165
 
78142
78166
 
@@ -78316,19 +78340,6 @@ function subtleMapping(jwk) {
78316
78340
  }
78317
78341
  break;
78318
78342
  }
78319
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'OKP':
78320
- if (jwk.alg !== 'EdDSA') {
78321
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78322
- }
78323
- switch (jwk.crv) {
78324
- case 'Ed25519':
78325
- algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78326
- keyUsages = jwk.d ? ['sign'] : ['verify'];
78327
- break;
78328
- default:
78329
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78330
- }
78331
- break;
78332
78343
  case 'OKP': {
78333
78344
  switch (jwk.alg) {
78334
78345
  case 'EdDSA':
@@ -78354,6 +78365,9 @@ function subtleMapping(jwk) {
78354
78365
  }
78355
78366
  const parse = async (jwk) => {
78356
78367
  var _a, _b;
78368
+ if (!jwk.alg) {
78369
+ throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
78370
+ }
78357
78371
  const { algorithm, keyUsages } = subtleMapping(jwk);
78358
78372
  const rest = [
78359
78373
  algorithm,
@@ -78366,7 +78380,18 @@ const parse = async (jwk) => {
78366
78380
  const keyData = { ...jwk };
78367
78381
  delete keyData.alg;
78368
78382
  delete keyData.use;
78369
- return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78383
+ try {
78384
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78385
+ }
78386
+ catch (err) {
78387
+ if (algorithm.name === 'Ed25519' &&
78388
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
78389
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
78390
+ rest[0] = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78391
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78392
+ }
78393
+ throw err;
78394
+ }
78370
78395
  };
78371
78396
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
78372
78397
 
@@ -78631,10 +78656,10 @@ function subtleDsa(alg, algorithm) {
78631
78656
  case 'ES384':
78632
78657
  case 'ES512':
78633
78658
  return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
78634
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA':
78635
- const { namedCurve } = algorithm;
78636
- return { name: namedCurve, namedCurve };
78637
78659
  case 'EdDSA':
78660
+ if ((0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && algorithm.name === 'NODE-ED25519') {
78661
+ return { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78662
+ }
78638
78663
  return { name: algorithm.name };
78639
78664
  default:
78640
78665
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
@@ -79058,6 +79083,7 @@ class JWKSMultipleMatchingKeys extends JOSEError {
79058
79083
  return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
79059
79084
  }
79060
79085
  }
79086
+ Symbol.asyncIterator;
79061
79087
  class JWKSTimeout extends JOSEError {
79062
79088
  constructor() {
79063
79089
  super(...arguments);