solid-ui 2.4.25 → 2.4.26-30b05927

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 (77) hide show
  1. package/dist/main.js +265 -235
  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.d.ts.map +1 -1
  32. package/lib/login/login.js +11 -9
  33. package/lib/login/login.js.map +1 -1
  34. package/lib/matrix/index.js.map +1 -1
  35. package/lib/matrix/matrix.js.map +1 -1
  36. package/lib/media/index.js.map +1 -1
  37. package/lib/media/media-capture.js.map +1 -1
  38. package/lib/messageArea.js.map +1 -1
  39. package/lib/noun_Camera_1618446_000000.js.map +1 -1
  40. package/lib/ns.js.map +1 -1
  41. package/lib/pad.js.map +1 -1
  42. package/lib/participation.js.map +1 -1
  43. package/lib/preferences.js.map +1 -1
  44. package/lib/signup/config-default.js.map +1 -1
  45. package/lib/signup/signup.js.map +1 -1
  46. package/lib/stories/decorators.js.map +1 -1
  47. package/lib/style.js.map +1 -1
  48. package/lib/style_multiSelect.js.map +1 -1
  49. package/lib/table.js.map +1 -1
  50. package/lib/tabs.js.map +1 -1
  51. package/lib/utils/headerFooterHelpers.js.map +1 -1
  52. package/lib/utils/index.js.map +1 -1
  53. package/lib/utils/label.js.map +1 -1
  54. package/lib/versionInfo.d.ts +2 -0
  55. package/lib/versionInfo.d.ts.map +1 -1
  56. package/lib/versionInfo.js +16 -14
  57. package/lib/versionInfo.js.map +1 -1
  58. package/lib/widgets/buttons/iconLinks.js.map +1 -1
  59. package/lib/widgets/buttons.js.map +1 -1
  60. package/lib/widgets/dragAndDrop.js.map +1 -1
  61. package/lib/widgets/error.js.map +1 -1
  62. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  63. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  64. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  65. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  66. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  67. package/lib/widgets/forms/basic.js.map +1 -1
  68. package/lib/widgets/forms/comment.js.map +1 -1
  69. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  70. package/lib/widgets/forms/fieldParams.js.map +1 -1
  71. package/lib/widgets/forms/formStyle.js.map +1 -1
  72. package/lib/widgets/forms.js.map +1 -1
  73. package/lib/widgets/index.js.map +1 -1
  74. package/lib/widgets/multiSelect.js.map +1 -1
  75. package/lib/widgets/peoplePicker.js.map +1 -1
  76. package/lib/widgets/widgetHelpers.js.map +1 -1
  77. 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 */
@@ -7155,7 +7155,7 @@ function renderSignInPopup(dom) {
7155
7155
  issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton);
7156
7156
  var loginToIssuer = /*#__PURE__*/function () {
7157
7157
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(issuerUri) {
7158
- var preLoginRedirectHash;
7158
+ var preLoginRedirectHash, locationUrl;
7159
7159
  return _regenerator["default"].wrap(function _callee$(_context) {
7160
7160
  while (1) switch (_context.prev = _context.next) {
7161
7161
  case 0:
@@ -7167,23 +7167,25 @@ function renderSignInPopup(dom) {
7167
7167
  }
7168
7168
  window.localStorage.setItem('loginIssuer', issuerUri);
7169
7169
  // Login
7170
- _context.next = 6;
7170
+ locationUrl = new URL(window.location.href);
7171
+ locationUrl.hash = ''; // remove hash part
7172
+ _context.next = 8;
7171
7173
  return _solidLogic.authSession.login({
7172
- redirectUrl: window.location.href,
7174
+ redirectUrl: locationUrl.href,
7173
7175
  oidcIssuer: issuerUri
7174
7176
  });
7175
- case 6:
7176
- _context.next = 11;
7177
- break;
7178
7177
  case 8:
7179
- _context.prev = 8;
7178
+ _context.next = 13;
7179
+ break;
7180
+ case 10:
7181
+ _context.prev = 10;
7180
7182
  _context.t0 = _context["catch"](0);
7181
7183
  (0, _log.alert)(_context.t0.message);
7182
- case 11:
7184
+ case 13:
7183
7185
  case "end":
7184
7186
  return _context.stop();
7185
7187
  }
7186
- }, _callee, null, [[0, 8]]);
7188
+ }, _callee, null, [[0, 10]]);
7187
7189
  }));
7188
7190
  return function loginToIssuer(_x11) {
7189
7191
  return _ref.apply(this, arguments);
@@ -13119,26 +13121,28 @@ Object.defineProperty(exports, "__esModule", ({
13119
13121
  }));
13120
13122
  exports.versionInfo = void 0;
13121
13123
  var versionInfo = {
13122
- buildTime: '2023-02-01T17:35:54Z',
13123
- commit: '2c72c08ab081c4727898740b46ba8d28777f4e56',
13124
+ buildTime: '2023-03-17T08:35:44Z',
13125
+ commit: '30b05927136712a9416d84debb90924567d9b790',
13124
13126
  npmInfo: {
13125
- 'solid-ui': '2.4.25',
13126
- npm: '8.19.3',
13127
- node: '14.21.2',
13128
- v8: '8.4.371.23-node.88',
13129
- uv: '1.42.0',
13127
+ 'solid-ui': '2.4.26',
13128
+ npm: '8.19.4',
13129
+ node: '16.19.1',
13130
+ v8: '9.4.146.26-node.24',
13131
+ uv: '1.43.0',
13130
13132
  zlib: '1.2.11',
13131
13133
  brotli: '1.0.9',
13132
13134
  ares: '1.18.1',
13133
- modules: '83',
13134
- nghttp2: '1.42.0',
13135
+ modules: '93',
13136
+ nghttp2: '1.47.0',
13135
13137
  napi: '8',
13136
- llhttp: '2.1.6',
13137
- openssl: '1.1.1s',
13138
- cldr: '40.0',
13139
- icu: '70.1',
13138
+ llhttp: '6.0.10',
13139
+ openssl: '1.1.1t+quic',
13140
+ cldr: '41.0',
13141
+ icu: '71.1',
13140
13142
  tz: '2022f',
13141
- unicode: '14.0'
13143
+ unicode: '14.0',
13144
+ ngtcp2: '0.8.1',
13145
+ nghttp3: '0.7.0'
13142
13146
  }
13143
13147
  };
13144
13148
  exports.versionInfo = versionInfo;
@@ -25644,7 +25648,10 @@ class ClientAuthentication {
25644
25648
  this.login = async (options, eventEmitter) => {
25645
25649
  var _a, _b;
25646
25650
  await this.sessionInfoManager.clear(options.sessionId);
25647
- const redirectUrl = (0, oidc_client_ext_1.removeOidcQueryParam)((_a = options.redirectUrl) !== null && _a !== void 0 ? _a : window.location.href);
25651
+ const redirectUrl = (_a = options.redirectUrl) !== null && _a !== void 0 ? _a : (0, oidc_client_ext_1.removeOidcQueryParam)(window.location.href);
25652
+ if (!(0, solid_client_authn_core_1.isValidRedirectUrl)(redirectUrl)) {
25653
+ throw new Error(`${redirectUrl} is not a valid redirect URL, it is either a malformed IRI or it includes a hash fragment.`);
25654
+ }
25648
25655
  await this.loginHandler.handle({
25649
25656
  ...options,
25650
25657
  redirectUrl,
@@ -26115,7 +26122,6 @@ exports["default"] = ClientRegistrar;
26115
26122
  Object.defineProperty(exports, "__esModule", ({ value: true }));
26116
26123
  exports.WELL_KNOWN_OPENID_CONFIG = void 0;
26117
26124
  const solid_client_authn_core_1 = __webpack_require__(/*! @inrupt/solid-client-authn-core */ "./node_modules/@inrupt/solid-client-authn-core/dist/index.js");
26118
- const urlPath_1 = __webpack_require__(/*! ../../util/urlPath */ "./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js");
26119
26125
  exports.WELL_KNOWN_OPENID_CONFIG = ".well-known/openid-configuration";
26120
26126
  const issuerConfigKeyMap = {
26121
26127
  issuer: {
@@ -26221,7 +26227,7 @@ class IssuerConfigFetcher {
26221
26227
  }
26222
26228
  async fetchConfig(issuer) {
26223
26229
  let issuerConfig;
26224
- const openIdConfigUrl = (0, urlPath_1.appendToUrlPathname)(issuer, exports.WELL_KNOWN_OPENID_CONFIG);
26230
+ const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer).href;
26225
26231
  const issuerConfigRequestBody = await window.fetch(openIdConfigUrl);
26226
26232
  try {
26227
26233
  issuerConfig = processConfig(await issuerConfigRequestBody.json());
@@ -26772,27 +26778,6 @@ exports["default"] = StorageUtilityBrowser;
26772
26778
 
26773
26779
  /***/ }),
26774
26780
 
26775
- /***/ "./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js":
26776
- /*!******************************************************************************!*\
26777
- !*** ./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js ***!
26778
- \******************************************************************************/
26779
- /***/ ((__unused_webpack_module, exports) => {
26780
-
26781
- "use strict";
26782
-
26783
- Object.defineProperty(exports, "__esModule", ({ value: true }));
26784
- exports.appendToUrlPathname = void 0;
26785
- function appendToUrlPathname(url, append) {
26786
- const parsedUrl = new URL(url);
26787
- const path = parsedUrl.pathname;
26788
- parsedUrl.pathname = `${path}${path.endsWith("/") ? "" : "/"}${append.startsWith("/") ? append.substring(1) : append}`;
26789
- return parsedUrl.toString();
26790
- }
26791
- exports.appendToUrlPathname = appendToUrlPathname;
26792
- //# sourceMappingURL=urlPath.js.map
26793
-
26794
- /***/ }),
26795
-
26796
26781
  /***/ "./node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/commonjs-browser/index.js":
26797
26782
  /*!**********************************************************************************************************!*\
26798
26783
  !*** ./node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/commonjs-browser/index.js ***!
@@ -27907,6 +27892,16 @@ async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
27907
27892
  }
27908
27893
  }
27909
27894
 
27895
+ function isValidRedirectUrl(redirectUrl) {
27896
+ try {
27897
+ const urlObject = new URL(redirectUrl);
27898
+ return urlObject.hash === "";
27899
+ }
27900
+ catch (e) {
27901
+ return false;
27902
+ }
27903
+ }
27904
+
27910
27905
  function isSupportedTokenType(token) {
27911
27906
  return typeof token === "string" && ["DPoP", "Bearer"].includes(token);
27912
27907
  }
@@ -28322,6 +28317,7 @@ exports.getSessionIdFromOauthState = getSessionIdFromOauthState;
28322
28317
  exports.getWebidFromTokenPayload = getWebidFromTokenPayload;
28323
28318
  exports.handleRegistration = handleRegistration;
28324
28319
  exports.isSupportedTokenType = isSupportedTokenType;
28320
+ exports.isValidRedirectUrl = isValidRedirectUrl;
28325
28321
  exports.loadOidcContextFromStorage = loadOidcContextFromStorage;
28326
28322
  exports.mockStorage = mockStorage;
28327
28323
  exports.mockStorageUtility = mockStorageUtility;
@@ -45273,7 +45269,7 @@ function () {
45273
45269
 
45274
45270
  return ConditionalRule;
45275
45271
  }();
45276
- var keyRegExp = /@media|@supports\s+/;
45272
+ var keyRegExp = /@container|@media|@supports\s+/;
45277
45273
  var pluginConditionalRule = {
45278
45274
  onCreateRule: function onCreateRule(key, styles, options) {
45279
45275
  return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;
@@ -46837,7 +46833,7 @@ var Jss =
46837
46833
  function () {
46838
46834
  function Jss(options) {
46839
46835
  this.id = instanceCounter++;
46840
- this.version = "10.9.2";
46836
+ this.version = "10.10.0";
46841
46837
  this.plugins = new PluginsRegistry();
46842
46838
  this.options = {
46843
46839
  id: {
@@ -54278,16 +54274,17 @@ var Fetcher = /*#__PURE__*/function () {
54278
54274
  var fetcher = this;
54279
54275
  // @ts-ignore
54280
54276
  if (fetcher.fetchQueue && fetcher.fetchQueue[uri]) {
54281
- console.log('Internal error - fetchQueue exists ' + uri);
54277
+ // console.log('Internal error - fetchQueue exists ' + uri)
54282
54278
  var promise = fetcher.fetchQueue[uri];
54283
54279
  if (promise['PromiseStatus'] === 'resolved') {
54284
54280
  delete fetcher.fetchQueue[uri];
54285
54281
  } else {
54286
54282
  // pending
54287
54283
  delete fetcher.fetchQueue[uri];
54288
- console.log('*** Fetcher: pending fetchQueue deleted ' + uri);
54284
+ // console.log('*** Fetcher: pending fetchQueue deleted ' + uri)
54289
54285
  }
54290
54286
  }
54287
+
54291
54288
  if (fetcher.requested[uri] && fetcher.requested[uri] !== 'done' && fetcher.requested[uri] !== 'failed' && fetcher.requested[uri] !== 404) {
54292
54289
  var msg = "Rdflib: fetcher: Destructive operation on <".concat(fetcher.requested[uri], "> file being fetched! ") + uri;
54293
54290
  console.error(msg);
@@ -61239,7 +61236,7 @@ contentType, callback, options) {
61239
61236
  documentString = sz.statementsToNTriples(newSts);
61240
61237
  return executeCallback(null, documentString);
61241
61238
  case _types__WEBPACK_IMPORTED_MODULE_0__.JSONLDContentType:
61242
- sz.setFlags('si'); // use turtle parameters
61239
+ sz.setFlags('si dr'); // turtle + dr (means no default, no relative prefix)
61243
61240
  documentString = sz.statementsToJsonld(newSts); // convert via turtle
61244
61241
  return executeCallback(null, documentString);
61245
61242
  case _types__WEBPACK_IMPORTED_MODULE_0__.NQuadsContentType:
@@ -61311,7 +61308,6 @@ __webpack_require__.r(__webpack_exports__);
61311
61308
 
61312
61309
 
61313
61310
 
61314
- // import * as jsonld from 'jsonld'
61315
61311
 
61316
61312
  function createSerializer(store) {
61317
61313
  return new Serializer(store);
@@ -61818,7 +61814,7 @@ var Serializer = /*#__PURE__*/function () {
61818
61814
  var termToN3 = termToN3Method.bind(this);
61819
61815
  function prefixDirectivesMethod() {
61820
61816
  var str = '';
61821
- if (this.defaultNamespace) {
61817
+ if (this.flags.indexOf('d') < 0 && this.defaultNamespace) {
61822
61818
  str += '@prefix : ' + this.explicitURI(this.defaultNamespace) + '.\n';
61823
61819
  }
61824
61820
  for (var ns in this.prefixes) {
@@ -62303,20 +62299,19 @@ var Serializer = /*#__PURE__*/function () {
62303
62299
  key: "statementsToJsonld",
62304
62300
  value: function statementsToJsonld(sts) {
62305
62301
  // ttl2jsonld creates context keys for all ttl prefix
62306
- // context keys must be full IRI
62307
- function findId(itemObj) {
62302
+ // context keys must be absolute IRI ttl2jsonld@0.0.8
62303
+ /* function findId (itemObj) {
62308
62304
  if (itemObj['@id']) {
62309
- var item = itemObj['@id'].split(':');
62310
- if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1];
62311
- }
62312
- var itemValues = Object.values(itemObj);
62313
- for (var i in itemValues) {
62314
- if (typeof itemValues[i] !== 'string') {
62315
- // @list contains array
62316
- findId(itemValues[i]);
62305
+ const item = itemObj['@id'].split(':')
62306
+ if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1]
62307
+ }
62308
+ const itemValues = Object.values(itemObj)
62309
+ for (const i in itemValues) {
62310
+ if (typeof itemValues[i] !== 'string') { // @list contains array
62311
+ findId(itemValues[i])
62317
62312
  }
62318
62313
  }
62319
- }
62314
+ } */
62320
62315
  var turtleDoc = this.statementsToN3(sts);
62321
62316
  var jsonldObj = _frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_4__.parse(turtleDoc);
62322
62317
  return JSON.stringify(jsonldObj, null, 2);
@@ -66818,15 +66813,13 @@ function createAclLogic(store) {
66818
66813
  var ns = ns_1.ns;
66819
66814
  function findAclDocUrl(url) {
66820
66815
  return __awaiter(this, void 0, void 0, function () {
66821
- var doc, docNode;
66816
+ var docNode;
66822
66817
  return __generator(this, function (_a) {
66823
66818
  switch (_a.label) {
66824
- case 0:
66825
- doc = store.sym(url);
66826
- return [4 /*yield*/, store.fetcher.load(doc)];
66819
+ case 0: return [4 /*yield*/, store.fetcher.load(url)];
66827
66820
  case 1:
66828
66821
  _a.sent();
66829
- docNode = store.any(doc, exports.ACL_LINK);
66822
+ docNode = store.any(url, exports.ACL_LINK);
66830
66823
  if (!docNode) {
66831
66824
  throw new Error("No ACL link discovered for ".concat(url));
66832
66825
  }
@@ -67634,7 +67627,7 @@ function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, acl
67634
67627
  case 2: return [4 /*yield*/, profileLogic.getMainInbox(user)];
67635
67628
  case 3:
67636
67629
  inbox = _a.sent();
67637
- return [4 /*yield*/, containerLogic.getContainerMembers(inbox.value)];
67630
+ return [4 /*yield*/, containerLogic.getContainerMembers(inbox)];
67638
67631
  case 4:
67639
67632
  urls = _a.sent();
67640
67633
  return [2 /*return*/, urls.filter(function (url) { return !containerLogic.isContainer(url); })];
@@ -68790,19 +68783,21 @@ var rdflib_1 = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/inde
68790
68783
  function createContainerLogic(store) {
68791
68784
  function getContainerElements(containerNode) {
68792
68785
  return store
68793
- .statementsMatching(containerNode, (0, rdflib_1.sym)("http://www.w3.org/ns/ldp#contains"), undefined, containerNode.doc())
68786
+ .statementsMatching(containerNode, (0, rdflib_1.sym)("http://www.w3.org/ns/ldp#contains"), undefined)
68794
68787
  .map(function (st) { return st.object; });
68795
68788
  }
68796
68789
  function isContainer(url) {
68797
- return url.charAt(url.length - 1) === "/";
68790
+ var nodeToString = url.value;
68791
+ return nodeToString.charAt(nodeToString.length - 1) === "/";
68798
68792
  }
68799
68793
  function createContainer(url) {
68800
68794
  return __awaiter(this, void 0, void 0, function () {
68801
- var result;
68795
+ var stringToNode, result;
68802
68796
  return __generator(this, function (_a) {
68803
68797
  switch (_a.label) {
68804
68798
  case 0:
68805
- if (!isContainer(url)) {
68799
+ stringToNode = (0, rdflib_1.sym)(url);
68800
+ if (!isContainer(stringToNode)) {
68806
68801
  throw new Error("Not a container URL ".concat(url));
68807
68802
  }
68808
68803
  return [4 /*yield*/, store.fetcher._fetch(url, {
@@ -68826,16 +68821,12 @@ function createContainerLogic(store) {
68826
68821
  }
68827
68822
  function getContainerMembers(containerUrl) {
68828
68823
  return __awaiter(this, void 0, void 0, function () {
68829
- var containerNode, nodes;
68830
68824
  return __generator(this, function (_a) {
68831
68825
  switch (_a.label) {
68832
- case 0:
68833
- containerNode = store.sym(containerUrl);
68834
- return [4 /*yield*/, store.fetcher.load(containerNode)];
68826
+ case 0: return [4 /*yield*/, store.fetcher.load(containerUrl)];
68835
68827
  case 1:
68836
68828
  _a.sent();
68837
- nodes = getContainerElements(containerNode);
68838
- return [2 /*return*/, nodes.map(function (node) { return node.value; })];
68829
+ return [2 /*return*/, getContainerElements(containerUrl)];
68839
68830
  }
68840
68831
  });
68841
68832
  });
@@ -69021,28 +69012,30 @@ var CustomError_1 = __webpack_require__(/*! ../logic/CustomError */ "./node_modu
69021
69012
  var debug = __importStar(__webpack_require__(/*! ../util/debug */ "./node_modules/solid-logic/lib/util/debug.js"));
69022
69013
  var utils_1 = __webpack_require__(/*! ./utils */ "./node_modules/solid-logic/lib/util/utils.js");
69023
69014
  function createUtilityLogic(store, aclLogic, containerLogic) {
69024
- function recursiveDelete(url) {
69015
+ function recursiveDelete(containerNode) {
69025
69016
  return __awaiter(this, void 0, void 0, function () {
69026
- var aclDocUrl, containerMembers, e_1;
69017
+ var aclDocUrl, containerMembers, nodeToStringHere, e_1;
69027
69018
  return __generator(this, function (_a) {
69028
69019
  switch (_a.label) {
69029
69020
  case 0:
69030
69021
  _a.trys.push([0, 6, , 7]);
69031
- if (!containerLogic.isContainer(url)) return [3 /*break*/, 5];
69032
- return [4 /*yield*/, aclLogic.findAclDocUrl(url)];
69022
+ if (!containerLogic.isContainer(containerNode)) return [3 /*break*/, 5];
69023
+ return [4 /*yield*/, aclLogic.findAclDocUrl(containerNode)];
69033
69024
  case 1:
69034
69025
  aclDocUrl = _a.sent();
69035
69026
  return [4 /*yield*/, store.fetcher._fetch(aclDocUrl, { method: "DELETE" })];
69036
69027
  case 2:
69037
69028
  _a.sent();
69038
- return [4 /*yield*/, containerLogic.getContainerMembers(url)];
69029
+ return [4 /*yield*/, containerLogic.getContainerMembers(containerNode)];
69039
69030
  case 3:
69040
69031
  containerMembers = _a.sent();
69041
69032
  return [4 /*yield*/, Promise.all(containerMembers.map(function (url) { return recursiveDelete(url); }))];
69042
69033
  case 4:
69043
69034
  _a.sent();
69044
69035
  _a.label = 5;
69045
- case 5: return [2 /*return*/, store.fetcher._fetch(url, { method: "DELETE" })];
69036
+ case 5:
69037
+ nodeToStringHere = containerNode.value;
69038
+ return [2 /*return*/, store.fetcher._fetch(nodeToStringHere, { method: "DELETE" })];
69046
69039
  case 6:
69047
69040
  e_1 = _a.sent();
69048
69041
  return [3 /*break*/, 7];
@@ -69187,7 +69180,7 @@ function createUtilityLogic(store, aclLogic, containerLogic) {
69187
69180
  ''
69188
69181
  ].join('\n');
69189
69182
  }
69190
- return [4 /*yield*/, aclLogic.findAclDocUrl(options.target)];
69183
+ return [4 /*yield*/, aclLogic.findAclDocUrl((0, rdflib_1.sym)(options.target))];
69191
69184
  case 1:
69192
69185
  aclDocUrl = _a.sent();
69193
69186
  return [2 /*return*/, store.fetcher._fetch(aclDocUrl, {
@@ -73559,6 +73552,7 @@ __webpack_require__.r(__webpack_exports__);
73559
73552
  /* harmony export */ "getWebidFromTokenPayload": () => (/* binding */ getWebidFromTokenPayload),
73560
73553
  /* harmony export */ "handleRegistration": () => (/* binding */ handleRegistration),
73561
73554
  /* harmony export */ "isSupportedTokenType": () => (/* binding */ isSupportedTokenType),
73555
+ /* harmony export */ "isValidRedirectUrl": () => (/* binding */ isValidRedirectUrl),
73562
73556
  /* harmony export */ "loadOidcContextFromStorage": () => (/* binding */ loadOidcContextFromStorage),
73563
73557
  /* harmony export */ "mockStorage": () => (/* binding */ mockStorage),
73564
73558
  /* harmony export */ "mockStorageUtility": () => (/* binding */ mockStorageUtility),
@@ -73665,6 +73659,16 @@ async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
73665
73659
  }
73666
73660
  }
73667
73661
 
73662
+ function isValidRedirectUrl(redirectUrl) {
73663
+ try {
73664
+ const urlObject = new URL(redirectUrl);
73665
+ return urlObject.hash === "";
73666
+ }
73667
+ catch (e) {
73668
+ return false;
73669
+ }
73670
+ }
73671
+
73668
73672
  function isSupportedTokenType(token) {
73669
73673
  return typeof token === "string" && ["DPoP", "Bearer"].includes(token);
73670
73674
  }
@@ -74889,7 +74893,7 @@ __webpack_require__.r(__webpack_exports__);
74889
74893
  async function EmbeddedJWK(protectedHeader, token) {
74890
74894
  const joseHeader = {
74891
74895
  ...protectedHeader,
74892
- ...token.header,
74896
+ ...token === null || token === void 0 ? void 0 : token.header,
74893
74897
  };
74894
74898
  if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_1__["default"])(joseHeader.jwk)) {
74895
74899
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');
@@ -75034,7 +75038,7 @@ class LocalJWKSet {
75034
75038
  this._jwks = clone(jwks);
75035
75039
  }
75036
75040
  async getKey(protectedHeader, token) {
75037
- const { alg, kid } = { ...protectedHeader, ...token.header };
75041
+ const { alg, kid } = { ...protectedHeader, ...token === null || token === void 0 ? void 0 : token.header };
75038
75042
  const kty = getKtyFromAlg(alg);
75039
75043
  const candidates = this._jwks.keys.filter((jwk) => {
75040
75044
  let candidate = kty === jwk.kty;
@@ -75076,21 +75080,39 @@ class LocalJWKSet {
75076
75080
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSNoMatchingKey();
75077
75081
  }
75078
75082
  else if (length !== 1) {
75079
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSMultipleMatchingKeys();
75083
+ const error = new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSMultipleMatchingKeys();
75084
+ const { _cached } = this;
75085
+ error[Symbol.asyncIterator] = async function* () {
75086
+ for (const jwk of candidates) {
75087
+ try {
75088
+ yield await importWithAlgCache(_cached, jwk, alg);
75089
+ }
75090
+ catch (_a) {
75091
+ continue;
75092
+ }
75093
+ }
75094
+ };
75095
+ throw error;
75080
75096
  }
75081
- const cached = this._cached.get(jwk) || this._cached.set(jwk, {}).get(jwk);
75082
- if (cached[alg] === undefined) {
75083
- const keyObject = await (0,_key_import_js__WEBPACK_IMPORTED_MODULE_0__.importJWK)({ ...jwk, ext: true }, alg);
75084
- if (keyObject instanceof Uint8Array || keyObject.type !== 'public') {
75085
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set members must be public keys');
75086
- }
75087
- cached[alg] = keyObject;
75097
+ return importWithAlgCache(this._cached, jwk, alg);
75098
+ }
75099
+ }
75100
+ async function importWithAlgCache(cache, jwk, alg) {
75101
+ const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk);
75102
+ if (cached[alg] === undefined) {
75103
+ const key = await (0,_key_import_js__WEBPACK_IMPORTED_MODULE_0__.importJWK)({ ...jwk, ext: true }, alg);
75104
+ if (key instanceof Uint8Array || key.type !== 'public') {
75105
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set members must be public keys');
75088
75106
  }
75089
- return cached[alg];
75107
+ cached[alg] = key;
75090
75108
  }
75109
+ return cached[alg];
75091
75110
  }
75092
75111
  function createLocalJWKSet(jwks) {
75093
- return LocalJWKSet.prototype.getKey.bind(new LocalJWKSet(jwks));
75112
+ const set = new LocalJWKSet(jwks);
75113
+ return async function (protectedHeader, token) {
75114
+ return set.getKey(protectedHeader, token);
75115
+ };
75094
75116
  }
75095
75117
 
75096
75118
 
@@ -75190,7 +75212,10 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
75190
75212
  }
75191
75213
  }
75192
75214
  function createRemoteJWKSet(url, options) {
75193
- return RemoteJWKSet.prototype.getKey.bind(new RemoteJWKSet(url, options));
75215
+ const set = new RemoteJWKSet(url, options);
75216
+ return async function (protectedHeader, token) {
75217
+ return set.getKey(protectedHeader, token);
75218
+ };
75194
75219
  }
75195
75220
 
75196
75221
 
@@ -76039,83 +76064,12 @@ __webpack_require__.r(__webpack_exports__);
76039
76064
  /* harmony import */ var _runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../runtime/asn1.js */ "./node_modules/jose/dist/browser/runtime/asn1.js");
76040
76065
  /* 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");
76041
76066
  /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
76042
- /* 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");
76043
- /* 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");
76044
-
76045
-
76067
+ /* 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");
76046
76068
 
76047
76069
 
76048
76070
 
76049
76071
 
76050
76072
 
76051
- function getElement(seq) {
76052
- let result = [];
76053
- let next = 0;
76054
- while (next < seq.length) {
76055
- let nextPart = parseElement(seq.subarray(next));
76056
- result.push(nextPart);
76057
- next += nextPart.byteLength;
76058
- }
76059
- return result;
76060
- }
76061
- function parseElement(bytes) {
76062
- let position = 0;
76063
- let tag = bytes[0] & 0x1f;
76064
- position++;
76065
- if (tag === 0x1f) {
76066
- tag = 0;
76067
- while (bytes[position] >= 0x80) {
76068
- tag = tag * 128 + bytes[position] - 0x80;
76069
- position++;
76070
- }
76071
- tag = tag * 128 + bytes[position] - 0x80;
76072
- position++;
76073
- }
76074
- let length = 0;
76075
- if (bytes[position] < 0x80) {
76076
- length = bytes[position];
76077
- position++;
76078
- }
76079
- else if (length === 0x80) {
76080
- length = 0;
76081
- while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
76082
- if (length > bytes.byteLength) {
76083
- throw new TypeError('invalid indefinite form length');
76084
- }
76085
- length++;
76086
- }
76087
- const byteLength = position + length + 2;
76088
- return {
76089
- byteLength,
76090
- contents: bytes.subarray(position, position + length),
76091
- raw: bytes.subarray(0, byteLength),
76092
- };
76093
- }
76094
- else {
76095
- let numberOfDigits = bytes[position] & 0x7f;
76096
- position++;
76097
- length = 0;
76098
- for (let i = 0; i < numberOfDigits; i++) {
76099
- length = length * 256 + bytes[position];
76100
- position++;
76101
- }
76102
- }
76103
- const byteLength = position + length;
76104
- return {
76105
- byteLength,
76106
- contents: bytes.subarray(position, byteLength),
76107
- raw: bytes.subarray(0, byteLength),
76108
- };
76109
- }
76110
- function spkiFromX509(buf) {
76111
- const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
76112
- return (0,_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
76113
- }
76114
- function getSPKI(x509) {
76115
- const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
76116
- const raw = (0,_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__.decodeBase64)(pem);
76117
- return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
76118
- }
76119
76073
  async function importSPKI(spki, alg, options) {
76120
76074
  if (typeof spki !== 'string' || spki.indexOf('-----BEGIN PUBLIC KEY-----') !== 0) {
76121
76075
  throw new TypeError('"spki" must be SPKI formatted string');
@@ -76126,14 +76080,7 @@ async function importX509(x509, alg, options) {
76126
76080
  if (typeof x509 !== 'string' || x509.indexOf('-----BEGIN CERTIFICATE-----') !== 0) {
76127
76081
  throw new TypeError('"x509" must be X.509 formatted string');
76128
76082
  }
76129
- let spki;
76130
- try {
76131
- spki = getSPKI(x509);
76132
- }
76133
- catch (cause) {
76134
- throw new TypeError('failed to parse the X.509 certificate', { cause });
76135
- }
76136
- return (0,_runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__.fromSPKI)(spki, alg, options);
76083
+ return (0,_runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__.fromX509)(x509, alg, options);
76137
76084
  }
76138
76085
  async function importPKCS8(pkcs8, alg, options) {
76139
76086
  if (typeof pkcs8 !== 'string' || pkcs8.indexOf('-----BEGIN PRIVATE KEY-----') !== 0) {
@@ -76143,13 +76090,10 @@ async function importPKCS8(pkcs8, alg, options) {
76143
76090
  }
76144
76091
  async function importJWK(jwk, alg, octAsKeyObject) {
76145
76092
  var _a;
76146
- if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_5__["default"])(jwk)) {
76093
+ if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_4__["default"])(jwk)) {
76147
76094
  throw new TypeError('JWK must be an object');
76148
76095
  }
76149
76096
  alg || (alg = jwk.alg);
76150
- if (typeof alg !== 'string' || !alg) {
76151
- throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
76152
- }
76153
76097
  switch (jwk.kty) {
76154
76098
  case 'oct':
76155
76099
  if (typeof jwk.k !== 'string' || !jwk.k) {
@@ -76516,13 +76460,13 @@ function checkSigCryptoKey(key, alg, ...usages) {
76516
76460
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
76517
76461
  break;
76518
76462
  }
76519
- case (0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA': {
76520
- if (!isAlgorithm(key.algorithm, 'NODE-ED25519'))
76521
- throw unusable('NODE-ED25519');
76522
- break;
76523
- }
76524
76463
  case 'EdDSA': {
76525
76464
  if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') {
76465
+ if ((0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
76466
+ if (isAlgorithm(key.algorithm, 'NODE-ED25519'))
76467
+ break;
76468
+ throw unusable('Ed25519, Ed448, or NODE-ED25519');
76469
+ }
76526
76470
  throw unusable('Ed25519 or Ed448');
76527
76471
  }
76528
76472
  break;
@@ -77338,6 +77282,7 @@ __webpack_require__.r(__webpack_exports__);
77338
77282
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
77339
77283
  /* harmony export */ "fromPKCS8": () => (/* binding */ fromPKCS8),
77340
77284
  /* harmony export */ "fromSPKI": () => (/* binding */ fromSPKI),
77285
+ /* harmony export */ "fromX509": () => (/* binding */ fromX509),
77341
77286
  /* harmony export */ "toPKCS8": () => (/* binding */ toPKCS8),
77342
77287
  /* harmony export */ "toSPKI": () => (/* binding */ toSPKI)
77343
77288
  /* harmony export */ });
@@ -77407,7 +77352,7 @@ const getNamedCurve = (keyData) => {
77407
77352
  }
77408
77353
  };
77409
77354
  const genericImport = async (replace, keyFormat, pem, alg, options) => {
77410
- var _a;
77355
+ var _a, _b;
77411
77356
  let algorithm;
77412
77357
  let keyUsages;
77413
77358
  const keyData = new Uint8Array(atob(pem.replace(replace, ''))
@@ -77458,12 +77403,6 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
77458
77403
  keyUsages = isPublic ? [] : ['deriveBits'];
77459
77404
  break;
77460
77405
  }
77461
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA': {
77462
- const namedCurve = getNamedCurve(keyData).toUpperCase();
77463
- algorithm = { name: `NODE-${namedCurve}`, namedCurve: `NODE-${namedCurve}` };
77464
- keyUsages = isPublic ? ['verify'] : ['sign'];
77465
- break;
77466
- }
77467
77406
  case 'EdDSA':
77468
77407
  algorithm = { name: getNamedCurve(keyData) };
77469
77408
  keyUsages = isPublic ? ['verify'] : ['sign'];
@@ -77471,7 +77410,18 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
77471
77410
  default:
77472
77411
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__.JOSENotSupported('Invalid or unsupported "alg" (Algorithm) value');
77473
77412
  }
77474
- 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);
77413
+ try {
77414
+ 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);
77415
+ }
77416
+ catch (err) {
77417
+ if (algorithm.name === 'Ed25519' &&
77418
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
77419
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
77420
+ algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
77421
+ 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);
77422
+ }
77423
+ throw err;
77424
+ }
77475
77425
  };
77476
77426
  const fromPKCS8 = (pem, alg, options) => {
77477
77427
  return genericImport(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g, 'pkcs8', pem, alg, options);
@@ -77479,6 +77429,84 @@ const fromPKCS8 = (pem, alg, options) => {
77479
77429
  const fromSPKI = (pem, alg, options) => {
77480
77430
  return genericImport(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, 'spki', pem, alg, options);
77481
77431
  };
77432
+ function getElement(seq) {
77433
+ let result = [];
77434
+ let next = 0;
77435
+ while (next < seq.length) {
77436
+ let nextPart = parseElement(seq.subarray(next));
77437
+ result.push(nextPart);
77438
+ next += nextPart.byteLength;
77439
+ }
77440
+ return result;
77441
+ }
77442
+ function parseElement(bytes) {
77443
+ let position = 0;
77444
+ let tag = bytes[0] & 0x1f;
77445
+ position++;
77446
+ if (tag === 0x1f) {
77447
+ tag = 0;
77448
+ while (bytes[position] >= 0x80) {
77449
+ tag = tag * 128 + bytes[position] - 0x80;
77450
+ position++;
77451
+ }
77452
+ tag = tag * 128 + bytes[position] - 0x80;
77453
+ position++;
77454
+ }
77455
+ let length = 0;
77456
+ if (bytes[position] < 0x80) {
77457
+ length = bytes[position];
77458
+ position++;
77459
+ }
77460
+ else if (length === 0x80) {
77461
+ length = 0;
77462
+ while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
77463
+ if (length > bytes.byteLength) {
77464
+ throw new TypeError('invalid indefinite form length');
77465
+ }
77466
+ length++;
77467
+ }
77468
+ const byteLength = position + length + 2;
77469
+ return {
77470
+ byteLength,
77471
+ contents: bytes.subarray(position, position + length),
77472
+ raw: bytes.subarray(0, byteLength),
77473
+ };
77474
+ }
77475
+ else {
77476
+ let numberOfDigits = bytes[position] & 0x7f;
77477
+ position++;
77478
+ length = 0;
77479
+ for (let i = 0; i < numberOfDigits; i++) {
77480
+ length = length * 256 + bytes[position];
77481
+ position++;
77482
+ }
77483
+ }
77484
+ const byteLength = position + length;
77485
+ return {
77486
+ byteLength,
77487
+ contents: bytes.subarray(position, byteLength),
77488
+ raw: bytes.subarray(0, byteLength),
77489
+ };
77490
+ }
77491
+ function spkiFromX509(buf) {
77492
+ const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
77493
+ return (0,_base64url_js__WEBPACK_IMPORTED_MODULE_3__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
77494
+ }
77495
+ function getSPKI(x509) {
77496
+ const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
77497
+ const raw = (0,_base64url_js__WEBPACK_IMPORTED_MODULE_3__.decodeBase64)(pem);
77498
+ return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
77499
+ }
77500
+ const fromX509 = (pem, alg, options) => {
77501
+ let spki;
77502
+ try {
77503
+ spki = getSPKI(pem);
77504
+ }
77505
+ catch (cause) {
77506
+ throw new TypeError('failed to parse the X.509 certificate', { cause });
77507
+ }
77508
+ return fromSPKI(spki, alg, options);
77509
+ };
77482
77510
 
77483
77511
 
77484
77512
  /***/ }),
@@ -78036,7 +78064,7 @@ function getModulusLengthOption(options) {
78036
78064
  return modulusLength;
78037
78065
  }
78038
78066
  async function generateKeyPair(alg, options) {
78039
- var _a, _b, _c;
78067
+ var _a, _b, _c, _d;
78040
78068
  let algorithm;
78041
78069
  let keyUsages;
78042
78070
  switch (alg) {
@@ -78086,17 +78114,6 @@ async function generateKeyPair(alg, options) {
78086
78114
  algorithm = { name: 'ECDSA', namedCurve: 'P-521' };
78087
78115
  keyUsages = ['sign', 'verify'];
78088
78116
  break;
78089
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA':
78090
- switch (options === null || options === void 0 ? void 0 : options.crv) {
78091
- case undefined:
78092
- case 'Ed25519':
78093
- algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78094
- keyUsages = ['sign', 'verify'];
78095
- break;
78096
- default:
78097
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported crv option provided');
78098
- }
78099
- break;
78100
78117
  case 'EdDSA':
78101
78118
  keyUsages = ['sign', 'verify'];
78102
78119
  const crv = (_a = options === null || options === void 0 ? void 0 : options.crv) !== null && _a !== void 0 ? _a : 'Ed25519';
@@ -78134,7 +78151,18 @@ async function generateKeyPair(alg, options) {
78134
78151
  default:
78135
78152
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78136
78153
  }
78137
- 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));
78154
+ try {
78155
+ 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));
78156
+ }
78157
+ catch (err) {
78158
+ if (algorithm.name === 'Ed25519' &&
78159
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
78160
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
78161
+ algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78162
+ 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));
78163
+ }
78164
+ throw err;
78165
+ }
78138
78166
  }
78139
78167
 
78140
78168
 
@@ -78314,19 +78342,6 @@ function subtleMapping(jwk) {
78314
78342
  }
78315
78343
  break;
78316
78344
  }
78317
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'OKP':
78318
- if (jwk.alg !== 'EdDSA') {
78319
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78320
- }
78321
- switch (jwk.crv) {
78322
- case 'Ed25519':
78323
- algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78324
- keyUsages = jwk.d ? ['sign'] : ['verify'];
78325
- break;
78326
- default:
78327
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78328
- }
78329
- break;
78330
78345
  case 'OKP': {
78331
78346
  switch (jwk.alg) {
78332
78347
  case 'EdDSA':
@@ -78352,6 +78367,9 @@ function subtleMapping(jwk) {
78352
78367
  }
78353
78368
  const parse = async (jwk) => {
78354
78369
  var _a, _b;
78370
+ if (!jwk.alg) {
78371
+ throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
78372
+ }
78355
78373
  const { algorithm, keyUsages } = subtleMapping(jwk);
78356
78374
  const rest = [
78357
78375
  algorithm,
@@ -78364,7 +78382,18 @@ const parse = async (jwk) => {
78364
78382
  const keyData = { ...jwk };
78365
78383
  delete keyData.alg;
78366
78384
  delete keyData.use;
78367
- return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78385
+ try {
78386
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78387
+ }
78388
+ catch (err) {
78389
+ if (algorithm.name === 'Ed25519' &&
78390
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
78391
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
78392
+ rest[0] = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78393
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78394
+ }
78395
+ throw err;
78396
+ }
78368
78397
  };
78369
78398
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
78370
78399
 
@@ -78629,10 +78658,10 @@ function subtleDsa(alg, algorithm) {
78629
78658
  case 'ES384':
78630
78659
  case 'ES512':
78631
78660
  return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
78632
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA':
78633
- const { namedCurve } = algorithm;
78634
- return { name: namedCurve, namedCurve };
78635
78661
  case 'EdDSA':
78662
+ if ((0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && algorithm.name === 'NODE-ED25519') {
78663
+ return { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78664
+ }
78636
78665
  return { name: algorithm.name };
78637
78666
  default:
78638
78667
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
@@ -79056,6 +79085,7 @@ class JWKSMultipleMatchingKeys extends JOSEError {
79056
79085
  return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
79057
79086
  }
79058
79087
  }
79088
+ Symbol.asyncIterator;
79059
79089
  class JWKSTimeout extends JOSEError {
79060
79090
  constructor() {
79061
79091
  super(...arguments);