solid-ui 2.4.16-6d61d9de → 2.4.16-74e478b4

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.
@@ -2252,7 +2252,7 @@ var AddAgentButtons = /*#__PURE__*/function () {
2252
2252
  switch (_context.prev = _context.next) {
2253
2253
  case 0:
2254
2254
  _context.next = 2;
2255
- return (0, _login.logInLoadProfile)(eventContext);
2255
+ return (0, _login.ensureLoadedProfile)(eventContext);
2256
2256
 
2257
2257
  case 2:
2258
2258
  trustedApps = this.groupList.store.each(eventContext.me, ns.acl('trustedApp')); // @@ TODO fix as
@@ -4938,6 +4938,8 @@ var _iconBase = __webpack_require__(/*! ../iconBase */ "./lib/iconBase.js");
4938
4938
 
4939
4939
  var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
4940
4940
 
4941
+ var _login = __webpack_require__(/*! ../login/login */ "./lib/login/login.js");
4942
+
4941
4943
  var _index = __webpack_require__(/*! ../media/index */ "./lib/media/index.js");
4942
4944
 
4943
4945
  var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js"));
@@ -5544,15 +5546,13 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
5544
5546
  div: middle,
5545
5547
  dom: dom
5546
5548
  };
5547
-
5548
- _solidLogic.authn.logIn(context).then(function (context) {
5549
+ (0, _login.ensureLoggedIn)(context).then(function (context) {
5549
5550
  // me = context.me
5550
5551
  turnOnInput();
5551
5552
  Object.assign(context, userContext);
5552
5553
  (0, _bookmarks.findBookmarkDocument)(context).then(function (_context) {// console.log('Bookmark file: ' + context.bookmarkDocument)
5553
5554
  });
5554
5555
  });
5555
-
5556
5556
  return messageEditor;
5557
5557
  } // renderMessageEditor
5558
5558
  //# sourceMappingURL=message.js.map
@@ -6111,7 +6111,7 @@ function newThingUI(createContext, dataBrowserContext, thePanes) {
6111
6111
  var selectUI; // , selectUIParent
6112
6112
 
6113
6113
  function callbackWS(ws, newBase) {
6114
- (0, _login.logInLoadProfile)(createContext).then(function (_context) {
6114
+ (0, _login.ensureLoadedProfile)(createContext).then(function (_context) {
6115
6115
  var newPaneOptions = Object.assign({
6116
6116
  newBase: newBase,
6117
6117
  folder: options.folder || undefined,
@@ -7354,7 +7354,7 @@ Object.defineProperty(exports, "messageArea", {
7354
7354
  return _messageArea.messageArea;
7355
7355
  }
7356
7356
  });
7357
- exports.style = exports.solidLogicLib = exports.rdf = exports.preferences = exports.participation = exports.pad = exports.ns = void 0;
7357
+ exports.style = exports.rdf = exports.preferences = exports.participation = exports.pad = exports.ns = void 0;
7358
7358
  Object.defineProperty(exports, "table", {
7359
7359
  enumerable: true,
7360
7360
  get: function get() {
@@ -7444,9 +7444,7 @@ var createTypes = _interopRequireWildcard(__webpack_require__(/*! ./create/types
7444
7444
 
7445
7445
  exports.createTypes = createTypes;
7446
7446
 
7447
- var solidLogicLib = _interopRequireWildcard(__webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js"));
7448
-
7449
- exports.solidLogicLib = solidLogicLib;
7447
+ var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
7450
7448
 
7451
7449
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
7452
7450
 
@@ -7455,9 +7453,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
7455
7453
  // pull in first avoid cross-refs
7456
7454
  // @ts-ignore
7457
7455
  // @ts-ignore
7458
- // import * as debug from '../debug'
7459
- // @ts-ignore
7460
- // @ts-ignore
7461
7456
  // @ts-ignore
7462
7457
  // @ts-ignore
7463
7458
  // @ts-ignore
@@ -7473,7 +7468,9 @@ exports.dom = dom;
7473
7468
  if (typeof window !== 'undefined') {
7474
7469
  ;
7475
7470
  window.UI = {
7476
- solidLogicLib: solidLogicLib,
7471
+ authn: _solidLogic.authn,
7472
+ store: _solidLogic.store,
7473
+ authSession: _solidLogic.authSession,
7477
7474
  ns: ns,
7478
7475
  rdf: rdf,
7479
7476
  acl: _index.acl,
@@ -7848,12 +7845,12 @@ var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_m
7848
7845
  Object.defineProperty(exports, "__esModule", {
7849
7846
  value: true
7850
7847
  });
7848
+ exports.ensureLoadedPreferences = ensureLoadedPreferences;
7849
+ exports.ensureLoadedProfile = ensureLoadedProfile;
7850
+ exports.ensureLoggedIn = ensureLoggedIn;
7851
7851
  exports.filterAvailablePanes = filterAvailablePanes;
7852
7852
  exports.findAppInstances = findAppInstances;
7853
7853
  exports.getUserRoles = getUserRoles;
7854
- exports.logInLoadPreferences = logInLoadPreferences;
7855
- exports.logInLoadProfile = logInLoadProfile;
7856
- exports.loggedInContext = loggedInContext;
7857
7854
  exports.loginStatusBox = loginStatusBox;
7858
7855
  exports.newAppInstance = newAppInstance;
7859
7856
  exports.registrationControl = registrationControl;
@@ -7914,7 +7911,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
7914
7911
  *
7915
7912
  * @param context
7916
7913
  */
7917
- function loggedInContext(context) {
7914
+ // used to be logIn
7915
+ function ensureLoggedIn(context) {
7918
7916
  var me = _solidLogic.authn.currentUser();
7919
7917
 
7920
7918
  if (me) {
@@ -7952,10 +7950,11 @@ function loggedInContext(context) {
7952
7950
  *
7953
7951
  * @param context
7954
7952
  */
7953
+ // used to be logInLoadPreferences
7955
7954
 
7956
7955
 
7957
- function logInLoadPreferences(_x2) {
7958
- return _logInLoadPreferences.apply(this, arguments);
7956
+ function ensureLoadedPreferences(_x2) {
7957
+ return _ensureLoadedPreferences.apply(this, arguments);
7959
7958
  }
7960
7959
  /**
7961
7960
  * Logs the user in and loads their WebID profile document into the store
@@ -7964,17 +7963,18 @@ function logInLoadPreferences(_x2) {
7964
7963
  *
7965
7964
  * @returns Resolves with the context after login / fetch
7966
7965
  */
7966
+ // used to be logInLoadProfile
7967
7967
 
7968
7968
 
7969
- function _logInLoadPreferences() {
7970
- _logInLoadPreferences = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(context) {
7969
+ function _ensureLoadedPreferences() {
7970
+ _ensureLoadedPreferences = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(context) {
7971
7971
  var statusArea, progressDisplay, complain, preferencesFile, m2;
7972
7972
  return _regenerator["default"].wrap(function _callee4$(_context4) {
7973
7973
  while (1) {
7974
7974
  switch (_context4.prev = _context4.next) {
7975
7975
  case 0:
7976
7976
  complain = function _complain(message) {
7977
- message = "logInLoadPreferences: ".concat(message);
7977
+ message = "ensureLoadedPreferences: ".concat(message);
7978
7978
 
7979
7979
  if (statusArea) {
7980
7980
  // statusArea.innerHTML = ''
@@ -7996,7 +7996,7 @@ function _logInLoadPreferences() {
7996
7996
  statusArea = context.statusArea || context.div || null;
7997
7997
  _context4.prev = 4;
7998
7998
  _context4.next = 7;
7999
- return logInLoadProfile(context);
7999
+ return ensureLoadedProfile(context);
8000
8000
 
8001
8001
  case 7:
8002
8002
  context = _context4.sent;
@@ -8097,11 +8097,11 @@ function _logInLoadPreferences() {
8097
8097
  }
8098
8098
  }, _callee4, null, [[4, 15]]);
8099
8099
  }));
8100
- return _logInLoadPreferences.apply(this, arguments);
8100
+ return _ensureLoadedPreferences.apply(this, arguments);
8101
8101
  }
8102
8102
 
8103
- function logInLoadProfile(_x3) {
8104
- return _logInLoadProfile.apply(this, arguments);
8103
+ function ensureLoadedProfile(_x3) {
8104
+ return _ensureLoadedProfile.apply(this, arguments);
8105
8105
  }
8106
8106
  /**
8107
8107
  * Returns promise of context with arrays of symbols
@@ -8111,8 +8111,8 @@ function logInLoadProfile(_x3) {
8111
8111
  */
8112
8112
 
8113
8113
 
8114
- function _logInLoadProfile() {
8115
- _logInLoadProfile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(context) {
8114
+ function _ensureLoadedProfile() {
8115
+ _ensureLoadedProfile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(context) {
8116
8116
  var logInContext;
8117
8117
  return _regenerator["default"].wrap(function _callee5$(_context5) {
8118
8118
  while (1) {
@@ -8128,7 +8128,7 @@ function _logInLoadProfile() {
8128
8128
  case 2:
8129
8129
  _context5.prev = 2;
8130
8130
  _context5.next = 5;
8131
- return loggedInContext(context);
8131
+ return ensureLoggedIn(context);
8132
8132
 
8133
8133
  case 5:
8134
8134
  logInContext = _context5.sent;
@@ -8169,7 +8169,7 @@ function _logInLoadProfile() {
8169
8169
  }
8170
8170
  }, _callee5, null, [[2, 13]]);
8171
8171
  }));
8172
- return _logInLoadProfile.apply(this, arguments);
8172
+ return _ensureLoadedProfile.apply(this, arguments);
8173
8173
  }
8174
8174
 
8175
8175
  function findAppInstances(_x4, _x5, _x6) {
@@ -8209,7 +8209,7 @@ function _findAppInstances() {
8209
8209
  case 7:
8210
8210
  _context6.prev = 7;
8211
8211
  _context6.next = 10;
8212
- return isPublic ? logInLoadProfile(context) : logInLoadPreferences(context);
8212
+ return isPublic ? ensureLoadedProfile(context) : ensureLoadedPreferences(context);
8213
8213
 
8214
8214
  case 10:
8215
8215
  _context6.next = 15;
@@ -9109,7 +9109,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
9109
9109
  // console.log('kicking off async operation')
9110
9110
 
9111
9111
 
9112
- logInLoadPreferences(context) // kick off async operation
9112
+ ensureLoadedPreferences(context) // kick off async operation
9113
9113
  .then(displayOptions)["catch"](function (err) {
9114
9114
  // console.log("err from async op")
9115
9115
  box.appendChild(widgets.errorMessageBlock(context.dom, err));
@@ -9168,7 +9168,7 @@ function getUserRoles() {
9168
9168
 
9169
9169
  function _getUserRoles() {
9170
9170
  _getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
9171
- var _yield$logInLoadPrefe, me, preferencesFile, preferencesFileError;
9171
+ var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError;
9172
9172
 
9173
9173
  return _regenerator["default"].wrap(function _callee7$(_context7) {
9174
9174
  while (1) {
@@ -9176,13 +9176,13 @@ function _getUserRoles() {
9176
9176
  case 0:
9177
9177
  _context7.prev = 0;
9178
9178
  _context7.next = 3;
9179
- return logInLoadPreferences({});
9179
+ return ensureLoadedPreferences({});
9180
9180
 
9181
9181
  case 3:
9182
- _yield$logInLoadPrefe = _context7.sent;
9183
- me = _yield$logInLoadPrefe.me;
9184
- preferencesFile = _yield$logInLoadPrefe.preferencesFile;
9185
- preferencesFileError = _yield$logInLoadPrefe.preferencesFileError;
9182
+ _yield$ensureLoadedPr = _context7.sent;
9183
+ me = _yield$ensureLoadedPr.me;
9184
+ preferencesFile = _yield$ensureLoadedPr.preferencesFile;
9185
+ preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
9186
9186
 
9187
9187
  if (!(!preferencesFile || preferencesFileError)) {
9188
9188
  _context7.next = 9;
@@ -10001,7 +10001,7 @@ function messageArea(dom, kb, subject, messageStore, options) {
10001
10001
  div: middle,
10002
10002
  dom: dom
10003
10003
  };
10004
- login.loggedInContext(context).then(function (context) {
10004
+ login.ensureLoggedIn(context).then(function (context) {
10005
10005
  me = context.me;
10006
10006
  turnOnInput();
10007
10007
  });
@@ -11615,7 +11615,7 @@ function recordSharedPreferences(subject, context) {
11615
11615
 
11616
11616
  function recordPersonalDefaults(theClass, context) {
11617
11617
  return new Promise(function (resolve, reject) {
11618
- (0, _login.logInLoadPreferences)(context).then(function (context) {
11618
+ (0, _login.ensureLoadedPreferences)(context).then(function (context) {
11619
11619
  if (!context.preferencesFile) {
11620
11620
  debug.log('Not doing private class preferences as no access to preferences file. ' + context.preferencesFileError);
11621
11621
  return;
@@ -15008,8 +15008,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
15008
15008
  var UI = {
15009
15009
  log: log,
15010
15010
  ns: ns,
15011
- rdf: rdf,
15012
- store: _solidLogic.store
15011
+ rdf: rdf
15013
15012
  }; // This ubiquitous function returns the best label for a thing
15014
15013
  //
15015
15014
  // The hacks in this code make a major difference to the usability
@@ -15127,8 +15126,8 @@ Object.defineProperty(exports, "__esModule", {
15127
15126
  });
15128
15127
  exports["default"] = void 0;
15129
15128
  var _default = {
15130
- buildTime: '2022-02-02T10:57:25Z',
15131
- commit: '6d61d9deb1fe9efedacdd966cb32a0f6aa5cd48a',
15129
+ buildTime: '2022-02-08T14:02:37Z',
15130
+ commit: '74e478b43cfcf957f74f614b1db113a5b325617d',
15132
15131
  npmInfo: {
15133
15132
  'solid-ui': '2.4.16',
15134
15133
  npm: '6.14.15',
@@ -20225,6 +20224,8 @@ function getPreferredLanguagesFor(_x) {
20225
20224
 
20226
20225
  function _getPreferredLanguagesFor() {
20227
20226
  _getPreferredLanguagesFor = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(person) {
20227
+ var _store$fetcher;
20228
+
20228
20229
  var doc, list, languageCodeArray;
20229
20230
  return _regenerator["default"].wrap(function _callee$(_context) {
20230
20231
  while (1) {
@@ -20232,7 +20233,7 @@ function _getPreferredLanguagesFor() {
20232
20233
  case 0:
20233
20234
  doc = person.doc();
20234
20235
  _context.next = 3;
20235
- return _solidLogic.store.fetcher.load(doc);
20236
+ return (_store$fetcher = _solidLogic.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.load(doc);
20236
20237
 
20237
20238
  case 3:
20238
20239
  list = _solidLogic.store.any(person, ns.schema('knowsLanguage'), null, doc);
@@ -20702,6 +20703,8 @@ function queryESCODataByName(_x, _x2, _x3) {
20702
20703
 
20703
20704
  function _queryESCODataByName() {
20704
20705
  _queryESCODataByName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(filter, theClass, queryTarget) {
20706
+ var _store$fetcher;
20707
+
20705
20708
  var limit, queryURI, response, text, json;
20706
20709
  return _regenerator["default"].wrap(function _callee$(_context) {
20707
20710
  while (1) {
@@ -20719,11 +20722,11 @@ function _queryESCODataByName() {
20719
20722
  queryURI = queryTarget.searchByNameURI.replace('$(name)', filter).replace('$(limit)', '' + limit).replace('$(targetClass)', theClass.toNT());
20720
20723
  debug.log('Querying ESCO data - uri: ' + queryURI);
20721
20724
  _context.next = 7;
20722
- return _solidLogic.store.fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
20725
+ return (_store$fetcher = _solidLogic.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
20723
20726
 
20724
20727
  case 7:
20725
20728
  response = _context.sent;
20726
- text = response.responseText || '';
20729
+ text = (response === null || response === void 0 ? void 0 : response.responseText) || '';
20727
20730
  debug.log(' Query result text' + text.slice(0, 500) + '...');
20728
20731
 
20729
20732
  if (!(text.length === 0)) {
@@ -20770,7 +20773,8 @@ function queryPublicDataByName(_x4, _x5, _x6, _x7) {
20770
20773
 
20771
20774
  function _queryPublicDataByName() {
20772
20775
  _queryPublicDataByName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(filter, theClass, languages, queryTarget) {
20773
- var substituteStrings, languagePrefs, language, sparql, queryURI, response, text, text2, json, bindings;
20776
+ var substituteStrings, languagePrefs, language, sparql, queryURI, response, _store$fetcher2, text, text2, json, bindings;
20777
+
20774
20778
  return _regenerator["default"].wrap(function _callee2$(_context2) {
20775
20779
  while (1) {
20776
20780
  switch (_context2.prev = _context2.next) {
@@ -20825,7 +20829,7 @@ function _queryPublicDataByName() {
20825
20829
  queryURI = substituteStrings(queryTarget.searchByNameURI);
20826
20830
  _context2.prev = 18;
20827
20831
  _context2.next = 21;
20828
- return _solidLogic.store.fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
20832
+ return (_store$fetcher2 = _solidLogic.store.fetcher) === null || _store$fetcher2 === void 0 ? void 0 : _store$fetcher2.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
20829
20833
 
20830
20834
  case 21:
20831
20835
  response = _context2.sent;
@@ -20902,6 +20906,8 @@ function queryPublicDataSelect(_x8, _x9) {
20902
20906
 
20903
20907
  function _queryPublicDataSelect() {
20904
20908
  _queryPublicDataSelect = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(sparql, queryTarget) {
20909
+ var _store$fetcher3;
20910
+
20905
20911
  var myUrlWithParams, queryURI, headers, options, response, text, text2, json, bindings;
20906
20912
  return _regenerator["default"].wrap(function _callee3$(_context3) {
20907
20913
  while (1) {
@@ -20927,7 +20933,7 @@ function _queryPublicDataSelect() {
20927
20933
  headers: headers
20928
20934
  };
20929
20935
  _context3.next = 11;
20930
- return _solidLogic.store.fetcher.webOperation('GET', queryURI, options);
20936
+ return (_store$fetcher3 = _solidLogic.store.fetcher) === null || _store$fetcher3 === void 0 ? void 0 : _store$fetcher3.webOperation('GET', queryURI, options);
20931
20937
 
20932
20938
  case 11:
20933
20939
  response = _context3.sent;
@@ -20963,6 +20969,8 @@ function queryPublicDataConstruct(_x10, _x11, _x12) {
20963
20969
 
20964
20970
  function _queryPublicDataConstruct() {
20965
20971
  _queryPublicDataConstruct = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(sparql, pubicId, queryTarget) {
20972
+ var _store$fetcher4;
20973
+
20966
20974
  var myUrlWithParams, queryURI, headers, options, response, text, report;
20967
20975
  return _regenerator["default"].wrap(function _callee4$(_context4) {
20968
20976
  while (1) {
@@ -20991,11 +20999,11 @@ function _queryPublicDataConstruct() {
20991
20999
 
20992
21000
  };
20993
21001
  _context4.next = 12;
20994
- return _solidLogic.store.fetcher.webOperation('GET', queryURI, options);
21002
+ return (_store$fetcher4 = _solidLogic.store.fetcher) === null || _store$fetcher4 === void 0 ? void 0 : _store$fetcher4.webOperation('GET', queryURI, options);
20995
21003
 
20996
21004
  case 12:
20997
21005
  response = _context4.sent;
20998
- text = response.responseText || 'No response text?';
21006
+ text = (response === null || response === void 0 ? void 0 : response.responseText) || 'No response text?';
20999
21007
  report = text.length > 500 ? text.slice(0, 200) + ' ... ' + text.slice(-200) : text;
21000
21008
  debug.log(' queryPublicDataConstruct result text:' + report);
21001
21009
 
@@ -23038,14 +23046,14 @@ function _inherits(subClass, superClass) {
23038
23046
  throw new TypeError("Super expression must either be null or a function");
23039
23047
  }
23040
23048
 
23049
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
23050
+ constructor: {
23051
+ value: subClass,
23052
+ writable: true,
23053
+ configurable: true
23054
+ }
23055
+ });
23041
23056
  Object.defineProperty(subClass, "prototype", {
23042
- value: Object.create(superClass && superClass.prototype, {
23043
- constructor: {
23044
- value: subClass,
23045
- writable: true,
23046
- configurable: true
23047
- }
23048
- }),
23049
23057
  writable: false
23050
23058
  });
23051
23059
  if (superClass) setPrototypeOf(subClass, superClass);
@@ -23174,7 +23182,7 @@ module.exports = _nonIterableRest, module.exports.__esModule = true, module.expo
23174
23182
  /*! no static exports found */
23175
23183
  /***/ (function(module, exports, __webpack_require__) {
23176
23184
 
23177
- var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"];
23185
+ var _typeof = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"];
23178
23186
 
23179
23187
  var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
23180
23188
 
@@ -30265,10 +30273,36 @@ var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/;
30265
30273
  var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;
30266
30274
  var FN_ARG_SPLIT = /,/;
30267
30275
  var FN_ARG = /(=.+)?(\s*)$/;
30268
- var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
30276
+
30277
+ function stripComments(string) {
30278
+ let stripped = '';
30279
+ let index = 0;
30280
+ let endBlockComment = string.indexOf('*/');
30281
+ while (index < string.length) {
30282
+ if (string[index] === '/' && string[index+1] === '/') {
30283
+ // inline comment
30284
+ let endIndex = string.indexOf('\n', index);
30285
+ index = (endIndex === -1) ? string.length : endIndex;
30286
+ } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) {
30287
+ // block comment
30288
+ let endIndex = string.indexOf('*/', index);
30289
+ if (endIndex !== -1) {
30290
+ index = endIndex + 2;
30291
+ endBlockComment = string.indexOf('*/', index);
30292
+ } else {
30293
+ stripped += string[index];
30294
+ index++;
30295
+ }
30296
+ } else {
30297
+ stripped += string[index];
30298
+ index++;
30299
+ }
30300
+ }
30301
+ return stripped;
30302
+ }
30269
30303
 
30270
30304
  function parseParams(func) {
30271
- const src = func.toString().replace(STRIP_COMMENTS, '');
30305
+ const src = stripComments(func.toString());
30272
30306
  let match = src.match(FN_ARGS);
30273
30307
  if (!match) {
30274
30308
  match = src.match(ARROW_FN_ARGS);
@@ -31025,7 +31059,7 @@ var reduce$1 = awaitify(reduce, 4);
31025
31059
  * app.get('/cats', function(request, response) {
31026
31060
  * var User = request.models.User;
31027
31061
  * async.seq(
31028
- * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
31062
+ * User.get.bind(User), // 'User.get' has signature (id, callback(err, data))
31029
31063
  * function(user, fn) {
31030
31064
  * user.getCats(fn); // 'getCats' has signature (callback(err, data))
31031
31065
  * }
@@ -32659,6 +32693,8 @@ function memoize(fn, hasher = v => v) {
32659
32693
  return memoized;
32660
32694
  }
32661
32695
 
32696
+ /* istanbul ignore file */
32697
+
32662
32698
  /**
32663
32699
  * Calls `callback` on a later loop around the event loop. In Node.js this just
32664
32700
  * calls `process.nextTick`. In the browser it will use `setImmediate` if
@@ -37541,7 +37577,7 @@ var irrelevant = (function (exports) {
37541
37577
 
37542
37578
  return exports;
37543
37579
 
37544
- }({}));
37580
+ })({});
37545
37581
  })(__self__);
37546
37582
  __self__.fetch.ponyfill = true;
37547
37583
  // Remove "polyfill" property added by whatwg-fetch
@@ -39013,7 +39049,7 @@ module.exports = Array.isArray || function (arr) {
39013
39049
  /*!*************************************************!*\
39014
39050
  !*** ./node_modules/jose/dist/browser/index.js ***!
39015
39051
  \*************************************************/
39016
- /*! exports provided: compactDecrypt, flattenedDecrypt, generalDecrypt, GeneralEncrypt, compactVerify, flattenedVerify, generalVerify, jwtVerify, jwtDecrypt, CompactEncrypt, FlattenedEncrypt, CompactSign, FlattenedSign, GeneralSign, SignJWT, EncryptJWT, calculateJwkThumbprint, EmbeddedJWK, createRemoteJWKSet, UnsecuredJWT, exportPKCS8, exportSPKI, exportJWK, importSPKI, importPKCS8, importX509, importJWK, decodeProtectedHeader, errors, generateKeyPair, generateSecret, base64url */
39052
+ /*! exports provided: compactDecrypt, flattenedDecrypt, generalDecrypt, GeneralEncrypt, compactVerify, flattenedVerify, generalVerify, jwtVerify, jwtDecrypt, CompactEncrypt, FlattenedEncrypt, CompactSign, FlattenedSign, GeneralSign, SignJWT, EncryptJWT, calculateJwkThumbprint, EmbeddedJWK, createLocalJWKSet, createRemoteJWKSet, UnsecuredJWT, exportPKCS8, exportSPKI, exportJWK, importSPKI, importPKCS8, importX509, importJWK, decodeProtectedHeader, errors, generateKeyPair, generateSecret, base64url */
39017
39053
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
39018
39054
 
39019
39055
  "use strict";
@@ -39072,41 +39108,45 @@ __webpack_require__.r(__webpack_exports__);
39072
39108
  /* harmony import */ var _jwk_embedded_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./jwk/embedded.js */ "./node_modules/jose/dist/browser/jwk/embedded.js");
39073
39109
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmbeddedJWK", function() { return _jwk_embedded_js__WEBPACK_IMPORTED_MODULE_17__["EmbeddedJWK"]; });
39074
39110
 
39075
- /* harmony import */ var _jwks_remote_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./jwks/remote.js */ "./node_modules/jose/dist/browser/jwks/remote.js");
39076
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return _jwks_remote_js__WEBPACK_IMPORTED_MODULE_18__["createRemoteJWKSet"]; });
39111
+ /* harmony import */ var _jwks_local_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./jwks/local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
39112
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLocalJWKSet", function() { return _jwks_local_js__WEBPACK_IMPORTED_MODULE_18__["createLocalJWKSet"]; });
39077
39113
 
39078
- /* harmony import */ var _jwt_unsecured_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./jwt/unsecured.js */ "./node_modules/jose/dist/browser/jwt/unsecured.js");
39079
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsecuredJWT", function() { return _jwt_unsecured_js__WEBPACK_IMPORTED_MODULE_19__["UnsecuredJWT"]; });
39114
+ /* harmony import */ var _jwks_remote_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./jwks/remote.js */ "./node_modules/jose/dist/browser/jwks/remote.js");
39115
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return _jwks_remote_js__WEBPACK_IMPORTED_MODULE_19__["createRemoteJWKSet"]; });
39080
39116
 
39081
- /* harmony import */ var _key_export_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./key/export.js */ "./node_modules/jose/dist/browser/key/export.js");
39082
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportPKCS8", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_20__["exportPKCS8"]; });
39117
+ /* harmony import */ var _jwt_unsecured_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./jwt/unsecured.js */ "./node_modules/jose/dist/browser/jwt/unsecured.js");
39118
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsecuredJWT", function() { return _jwt_unsecured_js__WEBPACK_IMPORTED_MODULE_20__["UnsecuredJWT"]; });
39083
39119
 
39084
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportSPKI", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_20__["exportSPKI"]; });
39120
+ /* harmony import */ var _key_export_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./key/export.js */ "./node_modules/jose/dist/browser/key/export.js");
39121
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportPKCS8", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_21__["exportPKCS8"]; });
39085
39122
 
39086
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportJWK", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_20__["exportJWK"]; });
39123
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportSPKI", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_21__["exportSPKI"]; });
39087
39124
 
39088
- /* harmony import */ var _key_import_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./key/import.js */ "./node_modules/jose/dist/browser/key/import.js");
39089
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importSPKI", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_21__["importSPKI"]; });
39125
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportJWK", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_21__["exportJWK"]; });
39090
39126
 
39091
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importPKCS8", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_21__["importPKCS8"]; });
39127
+ /* harmony import */ var _key_import_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./key/import.js */ "./node_modules/jose/dist/browser/key/import.js");
39128
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importSPKI", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importSPKI"]; });
39092
39129
 
39093
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importX509", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_21__["importX509"]; });
39130
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importPKCS8", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importPKCS8"]; });
39094
39131
 
39095
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importJWK", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_21__["importJWK"]; });
39132
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importX509", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importX509"]; });
39096
39133
 
39097
- /* harmony import */ var _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./util/decode_protected_header.js */ "./node_modules/jose/dist/browser/util/decode_protected_header.js");
39098
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeProtectedHeader", function() { return _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_22__["decodeProtectedHeader"]; });
39134
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importJWK", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importJWK"]; });
39099
39135
 
39100
- /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
39101
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "errors", function() { return _util_errors_js__WEBPACK_IMPORTED_MODULE_23__; });
39102
- /* harmony import */ var _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./key/generate_key_pair.js */ "./node_modules/jose/dist/browser/key/generate_key_pair.js");
39103
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateKeyPair", function() { return _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_24__["generateKeyPair"]; });
39136
+ /* harmony import */ var _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./util/decode_protected_header.js */ "./node_modules/jose/dist/browser/util/decode_protected_header.js");
39137
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeProtectedHeader", function() { return _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_23__["decodeProtectedHeader"]; });
39104
39138
 
39105
- /* harmony import */ var _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./key/generate_secret.js */ "./node_modules/jose/dist/browser/key/generate_secret.js");
39106
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSecret", function() { return _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_25__["generateSecret"]; });
39139
+ /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
39140
+ /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "errors", function() { return _util_errors_js__WEBPACK_IMPORTED_MODULE_24__; });
39141
+ /* harmony import */ var _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./key/generate_key_pair.js */ "./node_modules/jose/dist/browser/key/generate_key_pair.js");
39142
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateKeyPair", function() { return _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_25__["generateKeyPair"]; });
39143
+
39144
+ /* harmony import */ var _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./key/generate_secret.js */ "./node_modules/jose/dist/browser/key/generate_secret.js");
39145
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSecret", function() { return _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_26__["generateSecret"]; });
39146
+
39147
+ /* harmony import */ var _util_base64url_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./util/base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
39148
+ /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base64url", function() { return _util_base64url_js__WEBPACK_IMPORTED_MODULE_27__; });
39107
39149
 
39108
- /* harmony import */ var _util_base64url_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./util/base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
39109
- /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base64url", function() { return _util_base64url_js__WEBPACK_IMPORTED_MODULE_26__; });
39110
39150
 
39111
39151
 
39112
39152
 
@@ -39921,26 +39961,26 @@ async function calculateJwkThumbprint(jwk, digestAlgorithm = 'sha256') {
39921
39961
 
39922
39962
  /***/ }),
39923
39963
 
39924
- /***/ "./node_modules/jose/dist/browser/jwks/remote.js":
39925
- /*!*******************************************************!*\
39926
- !*** ./node_modules/jose/dist/browser/jwks/remote.js ***!
39927
- \*******************************************************/
39928
- /*! exports provided: createRemoteJWKSet */
39964
+ /***/ "./node_modules/jose/dist/browser/jwks/local.js":
39965
+ /*!******************************************************!*\
39966
+ !*** ./node_modules/jose/dist/browser/jwks/local.js ***!
39967
+ \******************************************************/
39968
+ /*! exports provided: isJWKSLike, LocalJWKSet, createLocalJWKSet */
39929
39969
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
39930
39970
 
39931
39971
  "use strict";
39932
39972
  __webpack_require__.r(__webpack_exports__);
39933
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return createRemoteJWKSet; });
39934
- /* harmony import */ var _runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../runtime/fetch_jwks.js */ "./node_modules/jose/dist/browser/runtime/fetch_jwks.js");
39935
- /* harmony import */ var _key_import_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../key/import.js */ "./node_modules/jose/dist/browser/key/import.js");
39936
- /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
39937
- /* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
39938
-
39973
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isJWKSLike", function() { return isJWKSLike; });
39974
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalJWKSet", function() { return LocalJWKSet; });
39975
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLocalJWKSet", function() { return createLocalJWKSet; });
39976
+ /* harmony import */ var _key_import_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../key/import.js */ "./node_modules/jose/dist/browser/key/import.js");
39977
+ /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
39978
+ /* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
39939
39979
 
39940
39980
 
39941
39981
 
39942
39982
  function getKtyFromAlg(alg) {
39943
- switch (typeof alg === 'string' && alg.substr(0, 2)) {
39983
+ switch (typeof alg === 'string' && alg.slice(0, 2)) {
39944
39984
  case 'RS':
39945
39985
  case 'PS':
39946
39986
  return 'RSA';
@@ -39949,39 +39989,37 @@ function getKtyFromAlg(alg) {
39949
39989
  case 'Ed':
39950
39990
  return 'OKP';
39951
39991
  default:
39952
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JOSENotSupported"]('Unsupported "alg" value for a JSON Web Key Set');
39992
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JOSENotSupported"]('Unsupported "alg" value for a JSON Web Key Set');
39953
39993
  }
39954
39994
  }
39995
+ function isJWKSLike(jwks) {
39996
+ return (jwks &&
39997
+ typeof jwks === 'object' &&
39998
+ Array.isArray(jwks.keys) &&
39999
+ jwks.keys.every(isJWKLike));
40000
+ }
39955
40001
  function isJWKLike(key) {
39956
- return Object(_lib_is_object_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
40002
+ return Object(_lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
39957
40003
  }
39958
- class RemoteJWKSet {
39959
- constructor(url, options) {
39960
- this._cached = new WeakMap();
39961
- if (!(url instanceof URL)) {
39962
- throw new TypeError('url must be an instance of URL');
39963
- }
39964
- this._url = new URL(url.href);
39965
- this._options = { agent: options === null || options === void 0 ? void 0 : options.agent };
39966
- this._timeoutDuration =
39967
- typeof (options === null || options === void 0 ? void 0 : options.timeoutDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.timeoutDuration : 5000;
39968
- this._cooldownDuration =
39969
- typeof (options === null || options === void 0 ? void 0 : options.cooldownDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.cooldownDuration : 30000;
40004
+ function clone(obj) {
40005
+ if (typeof structuredClone === 'function') {
40006
+ return structuredClone(obj);
39970
40007
  }
39971
- coolingDown() {
39972
- if (!this._cooldownStarted) {
39973
- return false;
40008
+ return JSON.parse(JSON.stringify(obj));
40009
+ }
40010
+ class LocalJWKSet {
40011
+ constructor(jwks) {
40012
+ this._cached = new WeakMap();
40013
+ if (!isJWKSLike(jwks)) {
40014
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSInvalid"]('JSON Web Key Set malformed');
39974
40015
  }
39975
- return Date.now() < this._cooldownStarted + this._cooldownDuration;
40016
+ this._jwks = clone(jwks);
39976
40017
  }
39977
40018
  async getKey(protectedHeader, token) {
39978
40019
  const joseHeader = {
39979
40020
  ...protectedHeader,
39980
40021
  ...token.header,
39981
40022
  };
39982
- if (!this._jwks) {
39983
- await this.reload();
39984
- }
39985
40023
  const candidates = this._jwks.keys.filter((jwk) => {
39986
40024
  let candidate = jwk.kty === getKtyFromAlg(joseHeader.alg);
39987
40025
  if (candidate && typeof joseHeader.kid === 'string') {
@@ -40020,34 +40058,88 @@ class RemoteJWKSet {
40020
40058
  });
40021
40059
  const { 0: jwk, length } = candidates;
40022
40060
  if (length === 0) {
40023
- if (this.coolingDown() === false) {
40024
- await this.reload();
40025
- return this.getKey(protectedHeader, token);
40026
- }
40027
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSNoMatchingKey"]();
40061
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSNoMatchingKey"]();
40028
40062
  }
40029
40063
  else if (length !== 1) {
40030
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSMultipleMatchingKeys"]();
40064
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSMultipleMatchingKeys"]();
40031
40065
  }
40032
40066
  const cached = this._cached.get(jwk) || this._cached.set(jwk, {}).get(jwk);
40033
40067
  if (cached[joseHeader.alg] === undefined) {
40034
- const keyObject = await Object(_key_import_js__WEBPACK_IMPORTED_MODULE_1__["importJWK"])({ ...jwk, ext: true }, joseHeader.alg);
40068
+ const keyObject = await Object(_key_import_js__WEBPACK_IMPORTED_MODULE_0__["importJWK"])({ ...jwk, ext: true }, joseHeader.alg);
40035
40069
  if (keyObject instanceof Uint8Array || keyObject.type !== 'public') {
40036
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSInvalid"]('JSON Web Key Set members must be public keys');
40070
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSInvalid"]('JSON Web Key Set members must be public keys');
40037
40071
  }
40038
40072
  cached[joseHeader.alg] = keyObject;
40039
40073
  }
40040
40074
  return cached[joseHeader.alg];
40041
40075
  }
40076
+ }
40077
+ function createLocalJWKSet(jwks) {
40078
+ return LocalJWKSet.prototype.getKey.bind(new LocalJWKSet(jwks));
40079
+ }
40080
+
40081
+
40082
+ /***/ }),
40083
+
40084
+ /***/ "./node_modules/jose/dist/browser/jwks/remote.js":
40085
+ /*!*******************************************************!*\
40086
+ !*** ./node_modules/jose/dist/browser/jwks/remote.js ***!
40087
+ \*******************************************************/
40088
+ /*! exports provided: createRemoteJWKSet */
40089
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
40090
+
40091
+ "use strict";
40092
+ __webpack_require__.r(__webpack_exports__);
40093
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return createRemoteJWKSet; });
40094
+ /* harmony import */ var _runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../runtime/fetch_jwks.js */ "./node_modules/jose/dist/browser/runtime/fetch_jwks.js");
40095
+ /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
40096
+ /* harmony import */ var _local_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
40097
+
40098
+
40099
+
40100
+ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_2__["LocalJWKSet"] {
40101
+ constructor(url, options) {
40102
+ super({ keys: [] });
40103
+ this._jwks = undefined;
40104
+ if (!(url instanceof URL)) {
40105
+ throw new TypeError('url must be an instance of URL');
40106
+ }
40107
+ this._url = new URL(url.href);
40108
+ this._options = { agent: options === null || options === void 0 ? void 0 : options.agent };
40109
+ this._timeoutDuration =
40110
+ typeof (options === null || options === void 0 ? void 0 : options.timeoutDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.timeoutDuration : 5000;
40111
+ this._cooldownDuration =
40112
+ typeof (options === null || options === void 0 ? void 0 : options.cooldownDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.cooldownDuration : 30000;
40113
+ }
40114
+ coolingDown() {
40115
+ if (!this._cooldownStarted) {
40116
+ return false;
40117
+ }
40118
+ return Date.now() < this._cooldownStarted + this._cooldownDuration;
40119
+ }
40120
+ async getKey(protectedHeader, token) {
40121
+ if (!this._jwks) {
40122
+ await this.reload();
40123
+ }
40124
+ try {
40125
+ return await super.getKey(protectedHeader, token);
40126
+ }
40127
+ catch (err) {
40128
+ if (err instanceof _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSNoMatchingKey"]) {
40129
+ if (this.coolingDown() === false) {
40130
+ await this.reload();
40131
+ return super.getKey(protectedHeader, token);
40132
+ }
40133
+ }
40134
+ throw err;
40135
+ }
40136
+ }
40042
40137
  async reload() {
40043
40138
  if (!this._pendingFetch) {
40044
40139
  this._pendingFetch = Object(_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
40045
40140
  .then((json) => {
40046
- if (typeof json !== 'object' ||
40047
- !json ||
40048
- !Array.isArray(json.keys) ||
40049
- !json.keys.every(isJWKLike)) {
40050
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSInvalid"]('JSON Web Key Set malformed');
40141
+ if (!Object(_local_js__WEBPACK_IMPORTED_MODULE_2__["isJWKSLike"])(json)) {
40142
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSInvalid"]('JSON Web Key Set malformed');
40051
40143
  }
40052
40144
  this._jwks = { keys: json.keys };
40053
40145
  this._cooldownStarted = Date.now();
@@ -41041,13 +41133,13 @@ __webpack_require__.r(__webpack_exports__);
41041
41133
 
41042
41134
 
41043
41135
  async function wrap(alg, key, cek, iv) {
41044
- const jweAlgorithm = alg.substr(0, 7);
41136
+ const jweAlgorithm = alg.slice(0, 7);
41045
41137
  iv || (iv = Object(_iv_js__WEBPACK_IMPORTED_MODULE_2__["default"])(jweAlgorithm));
41046
41138
  const { ciphertext: encryptedKey, tag } = await Object(_runtime_encrypt_js__WEBPACK_IMPORTED_MODULE_0__["default"])(jweAlgorithm, cek, key, iv, new Uint8Array(0));
41047
41139
  return { encryptedKey, iv: Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_3__["encode"])(iv), tag: Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_3__["encode"])(tag) };
41048
41140
  }
41049
41141
  async function unwrap(alg, key, encryptedKey, iv, tag) {
41050
- const jweAlgorithm = alg.substr(0, 7);
41142
+ const jweAlgorithm = alg.slice(0, 7);
41051
41143
  return Object(_runtime_decrypt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(jweAlgorithm, key, encryptedKey, iv, tag, new Uint8Array(0));
41052
41144
  }
41053
41145
 
@@ -41291,7 +41383,7 @@ function isAlgorithm(algorithm, name) {
41291
41383
  return algorithm.name === name;
41292
41384
  }
41293
41385
  function getHashLength(hash) {
41294
- return parseInt(hash.name.substr(4), 10);
41386
+ return parseInt(hash.name.slice(4), 10);
41295
41387
  }
41296
41388
  function getNamedCurve(alg) {
41297
41389
  switch (alg) {
@@ -41328,7 +41420,7 @@ function checkSigCryptoKey(key, alg, ...usages) {
41328
41420
  case 'HS512': {
41329
41421
  if (!isAlgorithm(key.algorithm, 'HMAC'))
41330
41422
  throw unusable('HMAC');
41331
- const expected = parseInt(alg.substr(2), 10);
41423
+ const expected = parseInt(alg.slice(2), 10);
41332
41424
  const actual = getHashLength(key.algorithm.hash);
41333
41425
  if (actual !== expected)
41334
41426
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
@@ -41339,7 +41431,7 @@ function checkSigCryptoKey(key, alg, ...usages) {
41339
41431
  case 'RS512': {
41340
41432
  if (!isAlgorithm(key.algorithm, 'RSASSA-PKCS1-v1_5'))
41341
41433
  throw unusable('RSASSA-PKCS1-v1_5');
41342
- const expected = parseInt(alg.substr(2), 10);
41434
+ const expected = parseInt(alg.slice(2), 10);
41343
41435
  const actual = getHashLength(key.algorithm.hash);
41344
41436
  if (actual !== expected)
41345
41437
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
@@ -41350,7 +41442,7 @@ function checkSigCryptoKey(key, alg, ...usages) {
41350
41442
  case 'PS512': {
41351
41443
  if (!isAlgorithm(key.algorithm, 'RSA-PSS'))
41352
41444
  throw unusable('RSA-PSS');
41353
- const expected = parseInt(alg.substr(2), 10);
41445
+ const expected = parseInt(alg.slice(2), 10);
41354
41446
  const actual = getHashLength(key.algorithm.hash);
41355
41447
  if (actual !== expected)
41356
41448
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
@@ -41389,7 +41481,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
41389
41481
  case 'A256GCM': {
41390
41482
  if (!isAlgorithm(key.algorithm, 'AES-GCM'))
41391
41483
  throw unusable('AES-GCM');
41392
- const expected = parseInt(alg.substr(1, 3), 10);
41484
+ const expected = parseInt(alg.slice(1, 4), 10);
41393
41485
  const actual = key.algorithm.length;
41394
41486
  if (actual !== expected)
41395
41487
  throw unusable(expected, 'algorithm.length');
@@ -41400,7 +41492,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
41400
41492
  case 'A256KW': {
41401
41493
  if (!isAlgorithm(key.algorithm, 'AES-KW'))
41402
41494
  throw unusable('AES-KW');
41403
- const expected = parseInt(alg.substr(1, 3), 10);
41495
+ const expected = parseInt(alg.slice(1, 4), 10);
41404
41496
  const actual = key.algorithm.length;
41405
41497
  if (actual !== expected)
41406
41498
  throw unusable(expected, 'algorithm.length');
@@ -41422,7 +41514,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
41422
41514
  case 'RSA-OAEP-512': {
41423
41515
  if (!isAlgorithm(key.algorithm, 'RSA-OAEP'))
41424
41516
  throw unusable('RSA-OAEP');
41425
- const expected = parseInt(alg.substr(9), 10) || 1;
41517
+ const expected = parseInt(alg.slice(9), 10) || 1;
41426
41518
  const actual = getHashLength(key.algorithm.hash);
41427
41519
  if (actual !== expected)
41428
41520
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
@@ -41499,12 +41591,12 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader) {
41499
41591
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JWEInvalid"](`JOSE Header "apv" (Agreement PartyVInfo) invalid`);
41500
41592
  partyVInfo = Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_4__["decode"])(joseHeader.apv);
41501
41593
  }
41502
- const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_6__["bitLength"])(joseHeader.enc) : parseInt(alg.substr(-5, 3), 10), partyUInfo, partyVInfo);
41594
+ const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_6__["bitLength"])(joseHeader.enc) : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
41503
41595
  if (alg === 'ECDH-ES')
41504
41596
  return sharedSecret;
41505
41597
  if (encryptedKey === undefined)
41506
41598
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JWEInvalid"]('JWE Encrypted Key missing');
41507
- return Object(_runtime_aeskw_js__WEBPACK_IMPORTED_MODULE_0__["unwrap"])(alg.substr(-6), sharedSecret, encryptedKey);
41599
+ return Object(_runtime_aeskw_js__WEBPACK_IMPORTED_MODULE_0__["unwrap"])(alg.slice(-6), sharedSecret, encryptedKey);
41508
41600
  }
41509
41601
  case 'RSA1_5':
41510
41602
  case 'RSA-OAEP':
@@ -41604,10 +41696,12 @@ async function encryptKeyManagement(alg, enc, key, providedCek, providedParamete
41604
41696
  }
41605
41697
  const { apu, apv } = providedParameters;
41606
41698
  let { epk: ephemeralKey } = providedParameters;
41607
- ephemeralKey || (ephemeralKey = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["generateEpk"](key));
41699
+ ephemeralKey || (ephemeralKey = (await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["generateEpk"](key)).privateKey);
41608
41700
  const { x, y, crv, kty } = await Object(_key_export_js__WEBPACK_IMPORTED_MODULE_7__["exportJWK"])(ephemeralKey);
41609
- const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_5__["bitLength"])(enc) : parseInt(alg.substr(-5, 3), 10), apu, apv);
41610
- parameters = { epk: { x, y, crv, kty } };
41701
+ const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_5__["bitLength"])(enc) : parseInt(alg.slice(-5, -2), 10), apu, apv);
41702
+ parameters = { epk: { x, crv, kty } };
41703
+ if (kty === 'EC')
41704
+ parameters.epk.y = y;
41611
41705
  if (apu)
41612
41706
  parameters.apu = Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_4__["encode"])(apu);
41613
41707
  if (apv)
@@ -41617,7 +41711,7 @@ async function encryptKeyManagement(alg, enc, key, providedCek, providedParamete
41617
41711
  break;
41618
41712
  }
41619
41713
  cek = providedCek || Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_5__["default"])(enc);
41620
- const kwAlg = alg.substr(-6);
41714
+ const kwAlg = alg.slice(-6);
41621
41715
  encryptedKey = await Object(_runtime_aeskw_js__WEBPACK_IMPORTED_MODULE_0__["wrap"])(kwAlg, sharedSecret, cek);
41622
41716
  break;
41623
41717
  }
@@ -42099,7 +42193,7 @@ __webpack_require__.r(__webpack_exports__);
42099
42193
 
42100
42194
 
42101
42195
  function checkKeySize(key, alg) {
42102
- if (key.algorithm.length !== parseInt(alg.substr(1, 3), 10)) {
42196
+ if (key.algorithm.length !== parseInt(alg.slice(1, 4), 10)) {
42103
42197
  throw new TypeError(`Invalid key size for alg: ${alg}`);
42104
42198
  }
42105
42199
  }
@@ -42174,29 +42268,30 @@ const toSPKI = (key) => {
42174
42268
  const toPKCS8 = (key) => {
42175
42269
  return genericExport('private', 'pkcs8', key);
42176
42270
  };
42271
+ const findOid = (keyData, oid, from = 0) => {
42272
+ if (from === 0) {
42273
+ oid.unshift(oid.length);
42274
+ oid.unshift(0x06);
42275
+ }
42276
+ let i = keyData.indexOf(oid[0], from);
42277
+ if (i === -1)
42278
+ return false;
42279
+ const sub = keyData.subarray(i, i + oid.length);
42280
+ if (sub.length !== oid.length)
42281
+ return false;
42282
+ return sub.every((value, index) => value === oid[index]) || findOid(keyData, oid, i + 1);
42283
+ };
42177
42284
  const getNamedCurve = (keyData) => {
42178
- const keyDataStr = keyData.toString();
42179
42285
  switch (true) {
42180
- case keyDataStr.includes(new Uint8Array([
42181
- 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce,
42182
- 0x3d, 0x03, 0x01, 0x07,
42183
- ]).toString()):
42286
+ case findOid(keyData, [0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07]):
42184
42287
  return 'P-256';
42185
- case keyDataStr.includes(new Uint8Array([
42186
- 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00,
42187
- 0x22,
42188
- ]).toString()):
42288
+ case findOid(keyData, [0x2b, 0x81, 0x04, 0x00, 0x22]):
42189
42289
  return 'P-384';
42190
- case keyDataStr.includes(new Uint8Array([
42191
- 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00,
42192
- 0x23,
42193
- ]).toString()):
42290
+ case findOid(keyData, [0x2b, 0x81, 0x04, 0x00, 0x23]):
42194
42291
  return 'P-521';
42195
- case (Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isCloudflareWorkers"])() || Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])()) &&
42196
- keyDataStr.includes(new Uint8Array([0x06, 0x03, 0x2b, 0x65, 0x70]).toString()):
42292
+ case (Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isCloudflareWorkers"])() || Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])()) && findOid(keyData, [0x2b, 0x65, 0x70]):
42197
42293
  return 'Ed25519';
42198
- case Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])() &&
42199
- keyDataStr.includes(new Uint8Array([0x06, 0x03, 0x2b, 0x65, 0x71]).toString()):
42294
+ case Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])() && findOid(keyData, [0x2b, 0x65, 0x71]):
42200
42295
  return 'Ed448';
42201
42296
  default:
42202
42297
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JOSENotSupported"]('Invalid or unsupported EC Key Curve or OKP Key Sub Type');
@@ -42214,13 +42309,13 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
42214
42309
  case 'PS256':
42215
42310
  case 'PS384':
42216
42311
  case 'PS512':
42217
- algorithm = { name: 'RSA-PSS', hash: `SHA-${alg.substr(-3)}` };
42312
+ algorithm = { name: 'RSA-PSS', hash: `SHA-${alg.slice(-3)}` };
42218
42313
  keyUsages = isPublic ? ['verify'] : ['sign'];
42219
42314
  break;
42220
42315
  case 'RS256':
42221
42316
  case 'RS384':
42222
42317
  case 'RS512':
42223
- algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${alg.substr(-3)}` };
42318
+ algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${alg.slice(-3)}` };
42224
42319
  keyUsages = isPublic ? ['verify'] : ['sign'];
42225
42320
  break;
42226
42321
  case 'RSA-OAEP':
@@ -42229,7 +42324,7 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
42229
42324
  case 'RSA-OAEP-512':
42230
42325
  algorithm = {
42231
42326
  name: 'RSA-OAEP',
42232
- hash: `SHA-${parseInt(alg.substr(-3), 10) || 1}`,
42327
+ hash: `SHA-${parseInt(alg.slice(-3), 10) || 1}`,
42233
42328
  };
42234
42329
  keyUsages = isPublic ? ['encrypt', 'wrapKey'] : ['decrypt', 'unwrapKey'];
42235
42330
  break;
@@ -42416,7 +42511,7 @@ async function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
42416
42511
  if (!(cek instanceof Uint8Array)) {
42417
42512
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_7__["default"])(cek, 'Uint8Array'));
42418
42513
  }
42419
- const keySize = parseInt(enc.substr(1, 3), 10);
42514
+ const keySize = parseInt(enc.slice(1, 4), 10);
42420
42515
  const encKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['decrypt']);
42421
42516
  const macKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
42422
42517
  hash: `SHA-${keySize << 1}`,
@@ -42475,13 +42570,13 @@ const decrypt = async (enc, cek, ciphertext, iv, tag, aad) => {
42475
42570
  case 'A192CBC-HS384':
42476
42571
  case 'A256CBC-HS512':
42477
42572
  if (cek instanceof Uint8Array)
42478
- Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.substr(-3), 10));
42573
+ Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(-3), 10));
42479
42574
  return cbcDecrypt(enc, cek, ciphertext, iv, tag, aad);
42480
42575
  case 'A128GCM':
42481
42576
  case 'A192GCM':
42482
42577
  case 'A256GCM':
42483
42578
  if (cek instanceof Uint8Array)
42484
- Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.substr(1, 3), 10));
42579
+ Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(1, 4), 10));
42485
42580
  return gcmDecrypt(enc, cek, ciphertext, iv, tag, aad);
42486
42581
  default:
42487
42582
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_4__["JOSENotSupported"]('Unsupported JWE Content Encryption Algorithm');
@@ -42504,7 +42599,7 @@ __webpack_require__.r(__webpack_exports__);
42504
42599
  /* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webcrypto.js */ "./node_modules/jose/dist/browser/runtime/webcrypto.js");
42505
42600
 
42506
42601
  const digest = async (algorithm, data) => {
42507
- const subtleDigest = `SHA-${algorithm.substr(-3)}`;
42602
+ const subtleDigest = `SHA-${algorithm.slice(-3)}`;
42508
42603
  return new Uint8Array(await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.digest(subtleDigest, data));
42509
42604
  };
42510
42605
  /* harmony default export */ __webpack_exports__["default"] = (digest);
@@ -42536,7 +42631,7 @@ __webpack_require__.r(__webpack_exports__);
42536
42631
 
42537
42632
 
42538
42633
 
42539
- const deriveKey = async (publicKey, privateKey, algorithm, keyLength, apu = new Uint8Array(0), apv = new Uint8Array(0)) => {
42634
+ async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new Uint8Array(0), apv = new Uint8Array(0)) {
42540
42635
  if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(publicKey)) {
42541
42636
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_4__["default"])(publicKey, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__["types"]));
42542
42637
  }
@@ -42552,22 +42647,21 @@ const deriveKey = async (publicKey, privateKey, algorithm, keyLength, apu = new
42552
42647
  const sharedSecret = new Uint8Array(await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.deriveBits({
42553
42648
  name: 'ECDH',
42554
42649
  public: publicKey,
42555
- }, privateKey, Math.ceil(parseInt(privateKey.algorithm.namedCurve.substr(-3), 10) / 8) <<
42556
- 3));
42650
+ }, privateKey, Math.ceil(parseInt(privateKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3));
42557
42651
  return Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["concatKdf"])(_digest_js__WEBPACK_IMPORTED_MODULE_3__["default"], sharedSecret, keyLength, value);
42558
- };
42559
- const generateEpk = async (key) => {
42652
+ }
42653
+ async function generateEpk(key) {
42560
42654
  if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(key)) {
42561
42655
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__["types"]));
42562
42656
  }
42563
- return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey({ name: 'ECDH', namedCurve: key.algorithm.namedCurve }, true, ['deriveBits'])).privateKey;
42564
- };
42565
- const ecdhAllowed = (key) => {
42657
+ return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(key.algorithm, true, ['deriveBits']);
42658
+ }
42659
+ function ecdhAllowed(key) {
42566
42660
  if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(key)) {
42567
42661
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__["types"]));
42568
42662
  }
42569
42663
  return ['P-256', 'P-384', 'P-521'].includes(key.algorithm.namedCurve);
42570
- };
42664
+ }
42571
42665
 
42572
42666
 
42573
42667
  /***/ }),
@@ -42601,7 +42695,7 @@ async function cbcEncrypt(enc, plaintext, cek, iv, aad) {
42601
42695
  if (!(cek instanceof Uint8Array)) {
42602
42696
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_5__["default"])(cek, 'Uint8Array'));
42603
42697
  }
42604
- const keySize = parseInt(enc.substr(1, 3), 10);
42698
+ const keySize = parseInt(enc.slice(1, 4), 10);
42605
42699
  const encKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_3__["default"].subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['encrypt']);
42606
42700
  const macKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_3__["default"].subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
42607
42701
  hash: `SHA-${keySize << 1}`,
@@ -42644,13 +42738,13 @@ const encrypt = async (enc, plaintext, cek, iv, aad) => {
42644
42738
  case 'A192CBC-HS384':
42645
42739
  case 'A256CBC-HS512':
42646
42740
  if (cek instanceof Uint8Array)
42647
- Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.substr(-3), 10));
42741
+ Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(-3), 10));
42648
42742
  return cbcEncrypt(enc, plaintext, cek, iv, aad);
42649
42743
  case 'A128GCM':
42650
42744
  case 'A192GCM':
42651
42745
  case 'A256GCM':
42652
42746
  if (cek instanceof Uint8Array)
42653
- Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.substr(1, 3), 10));
42747
+ Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(1, 4), 10));
42654
42748
  return gcmEncrypt(enc, plaintext, cek, iv, aad);
42655
42749
  default:
42656
42750
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_6__["JOSENotSupported"]('Unsupported JWE Content Encryption Algorithm');
@@ -42773,19 +42867,19 @@ async function generateSecret(alg, options) {
42773
42867
  case 'HS256':
42774
42868
  case 'HS384':
42775
42869
  case 'HS512':
42776
- length = parseInt(alg.substr(-3), 10);
42870
+ length = parseInt(alg.slice(-3), 10);
42777
42871
  algorithm = { name: 'HMAC', hash: `SHA-${length}`, length };
42778
42872
  keyUsages = ['sign', 'verify'];
42779
42873
  break;
42780
42874
  case 'A128CBC-HS256':
42781
42875
  case 'A192CBC-HS384':
42782
42876
  case 'A256CBC-HS512':
42783
- length = parseInt(alg.substr(-3), 10);
42877
+ length = parseInt(alg.slice(-3), 10);
42784
42878
  return Object(_random_js__WEBPACK_IMPORTED_MODULE_3__["default"])(new Uint8Array(length >> 3));
42785
42879
  case 'A128KW':
42786
42880
  case 'A192KW':
42787
42881
  case 'A256KW':
42788
- length = parseInt(alg.substring(1, 4), 10);
42882
+ length = parseInt(alg.slice(1, 4), 10);
42789
42883
  algorithm = { name: 'AES-KW', length };
42790
42884
  keyUsages = ['wrapKey', 'unwrapKey'];
42791
42885
  break;
@@ -42795,7 +42889,7 @@ async function generateSecret(alg, options) {
42795
42889
  case 'A128GCM':
42796
42890
  case 'A192GCM':
42797
42891
  case 'A256GCM':
42798
- length = parseInt(alg.substring(1, 4), 10);
42892
+ length = parseInt(alg.slice(1, 4), 10);
42799
42893
  algorithm = { name: 'AES-GCM', length };
42800
42894
  keyUsages = ['encrypt', 'decrypt'];
42801
42895
  break;
@@ -42822,7 +42916,7 @@ async function generateKeyPair(alg, options) {
42822
42916
  case 'PS512':
42823
42917
  algorithm = {
42824
42918
  name: 'RSA-PSS',
42825
- hash: `SHA-${alg.substr(-3)}`,
42919
+ hash: `SHA-${alg.slice(-3)}`,
42826
42920
  publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
42827
42921
  modulusLength: getModulusLengthOption(options),
42828
42922
  };
@@ -42833,7 +42927,7 @@ async function generateKeyPair(alg, options) {
42833
42927
  case 'RS512':
42834
42928
  algorithm = {
42835
42929
  name: 'RSASSA-PKCS1-v1_5',
42836
- hash: `SHA-${alg.substr(-3)}`,
42930
+ hash: `SHA-${alg.slice(-3)}`,
42837
42931
  publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
42838
42932
  modulusLength: getModulusLengthOption(options),
42839
42933
  };
@@ -42845,7 +42939,7 @@ async function generateKeyPair(alg, options) {
42845
42939
  case 'RSA-OAEP-512':
42846
42940
  algorithm = {
42847
42941
  name: 'RSA-OAEP',
42848
- hash: `SHA-${parseInt(alg.substr(-3), 10) || 1}`,
42942
+ hash: `SHA-${parseInt(alg.slice(-3), 10) || 1}`,
42849
42943
  publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
42850
42944
  modulusLength: getModulusLengthOption(options),
42851
42945
  };
@@ -42921,7 +43015,7 @@ function getCryptoKey(alg, key, usage) {
42921
43015
  if (!alg.startsWith('HS')) {
42922
43016
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_2__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_3__["types"]));
42923
43017
  }
42924
- return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey('raw', key, { hash: `SHA-${alg.substr(-3)}`, name: 'HMAC' }, false, [usage]);
43018
+ return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey('raw', key, { hash: `SHA-${alg.slice(-3)}`, name: 'HMAC' }, false, [usage]);
42925
43019
  }
42926
43020
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_2__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_3__["types"], 'Uint8Array'));
42927
43021
  }
@@ -42975,7 +43069,7 @@ function subtleMapping(jwk) {
42975
43069
  case 'HS256':
42976
43070
  case 'HS384':
42977
43071
  case 'HS512':
42978
- algorithm = { name: 'HMAC', hash: `SHA-${jwk.alg.substr(-3)}` };
43072
+ algorithm = { name: 'HMAC', hash: `SHA-${jwk.alg.slice(-3)}` };
42979
43073
  keyUsages = ['sign', 'verify'];
42980
43074
  break;
42981
43075
  case 'A128CBC-HS256':
@@ -43013,13 +43107,13 @@ function subtleMapping(jwk) {
43013
43107
  case 'PS256':
43014
43108
  case 'PS384':
43015
43109
  case 'PS512':
43016
- algorithm = { name: 'RSA-PSS', hash: `SHA-${jwk.alg.substr(-3)}` };
43110
+ algorithm = { name: 'RSA-PSS', hash: `SHA-${jwk.alg.slice(-3)}` };
43017
43111
  keyUsages = jwk.d ? ['sign'] : ['verify'];
43018
43112
  break;
43019
43113
  case 'RS256':
43020
43114
  case 'RS384':
43021
43115
  case 'RS512':
43022
- algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${jwk.alg.substr(-3)}` };
43116
+ algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${jwk.alg.slice(-3)}` };
43023
43117
  keyUsages = jwk.d ? ['sign'] : ['verify'];
43024
43118
  break;
43025
43119
  case 'RSA-OAEP':
@@ -43028,7 +43122,7 @@ function subtleMapping(jwk) {
43028
43122
  case 'RSA-OAEP-512':
43029
43123
  algorithm = {
43030
43124
  name: 'RSA-OAEP',
43031
- hash: `SHA-${parseInt(jwk.alg.substr(-3), 10) || 1}`,
43125
+ hash: `SHA-${parseInt(jwk.alg.slice(-3), 10) || 1}`,
43032
43126
  };
43033
43127
  keyUsages = jwk.d ? ['decrypt', 'unwrapKey'] : ['encrypt', 'wrapKey'];
43034
43128
  break;
@@ -43185,9 +43279,9 @@ function getCryptoKey(key, alg) {
43185
43279
  async function deriveKey(p2s, alg, p2c, key) {
43186
43280
  Object(_lib_check_p2s_js__WEBPACK_IMPORTED_MODULE_4__["default"])(p2s);
43187
43281
  const salt = Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_1__["p2s"])(alg, p2s);
43188
- const keylen = parseInt(alg.substr(13, 3), 10);
43282
+ const keylen = parseInt(alg.slice(13, 16), 10);
43189
43283
  const subtleAlg = {
43190
- hash: `SHA-${alg.substr(8, 3)}`,
43284
+ hash: `SHA-${alg.slice(8, 11)}`,
43191
43285
  iterations: p2c,
43192
43286
  name: 'PBKDF2',
43193
43287
  salt,
@@ -43207,12 +43301,12 @@ async function deriveKey(p2s, alg, p2c, key) {
43207
43301
  }
43208
43302
  const encrypt = async (alg, key, cek, p2c = Math.floor(Math.random() * 2049) + 2048, p2s = Object(_random_js__WEBPACK_IMPORTED_MODULE_0__["default"])(new Uint8Array(16))) => {
43209
43303
  const derived = await deriveKey(p2s, alg, p2c, key);
43210
- const encryptedKey = await Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["wrap"])(alg.substr(-6), derived, cek);
43304
+ const encryptedKey = await Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["wrap"])(alg.slice(-6), derived, cek);
43211
43305
  return { encryptedKey, p2c, p2s: Object(_base64url_js__WEBPACK_IMPORTED_MODULE_2__["encode"])(p2s) };
43212
43306
  };
43213
43307
  const decrypt = async (alg, key, encryptedKey, p2c, p2s) => {
43214
43308
  const derived = await deriveKey(p2s, alg, p2c, key);
43215
- return Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["unwrap"])(alg.substr(-6), derived, encryptedKey);
43309
+ return Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["unwrap"])(alg.slice(-6), derived, encryptedKey);
43216
43310
  };
43217
43311
 
43218
43312
 
@@ -43313,7 +43407,7 @@ __webpack_require__.r(__webpack_exports__);
43313
43407
  const sign = async (alg, key, data) => {
43314
43408
  const cryptoKey = await Object(_get_sign_verify_key_js__WEBPACK_IMPORTED_MODULE_3__["default"])(alg, key, 'sign');
43315
43409
  Object(_check_key_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(alg, cryptoKey);
43316
- const signature = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.sign(Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm.namedCurve), cryptoKey, data);
43410
+ const signature = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.sign(Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm), cryptoKey, data);
43317
43411
  return new Uint8Array(signature);
43318
43412
  };
43319
43413
  /* harmony default export */ __webpack_exports__["default"] = (sign);
@@ -43335,26 +43429,27 @@ __webpack_require__.r(__webpack_exports__);
43335
43429
  /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
43336
43430
 
43337
43431
 
43338
- function subtleDsa(alg, namedCurve) {
43339
- const length = parseInt(alg.substr(-3), 10);
43432
+ function subtleDsa(alg, algorithm) {
43433
+ const hash = `SHA-${alg.slice(-3)}`;
43340
43434
  switch (alg) {
43341
43435
  case 'HS256':
43342
43436
  case 'HS384':
43343
43437
  case 'HS512':
43344
- return { hash: `SHA-${length}`, name: 'HMAC' };
43438
+ return { hash, name: 'HMAC' };
43345
43439
  case 'PS256':
43346
43440
  case 'PS384':
43347
43441
  case 'PS512':
43348
- return { hash: `SHA-${length}`, name: 'RSA-PSS', saltLength: length >> 3 };
43442
+ return { hash, name: 'RSA-PSS', saltLength: alg.slice(-3) >> 3 };
43349
43443
  case 'RS256':
43350
43444
  case 'RS384':
43351
43445
  case 'RS512':
43352
- return { hash: `SHA-${length}`, name: 'RSASSA-PKCS1-v1_5' };
43446
+ return { hash, name: 'RSASSA-PKCS1-v1_5' };
43353
43447
  case 'ES256':
43354
43448
  case 'ES384':
43355
43449
  case 'ES512':
43356
- return { hash: `SHA-${length}`, name: 'ECDSA', namedCurve };
43450
+ return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
43357
43451
  case (Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isCloudflareWorkers"])() || Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])()) && 'EdDSA':
43452
+ const { namedCurve } = algorithm;
43358
43453
  return { name: namedCurve, namedCurve };
43359
43454
  default:
43360
43455
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JOSENotSupported"](`alg ${alg} is not supported either by JOSE or your javascript runtime`);
@@ -43443,7 +43538,7 @@ __webpack_require__.r(__webpack_exports__);
43443
43538
  const verify = async (alg, key, signature, data) => {
43444
43539
  const cryptoKey = await Object(_get_sign_verify_key_js__WEBPACK_IMPORTED_MODULE_3__["default"])(alg, key, 'verify');
43445
43540
  Object(_check_key_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(alg, cryptoKey);
43446
- const algorithm = Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm.namedCurve);
43541
+ const algorithm = Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm);
43447
43542
  try {
43448
43543
  return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.verify(algorithm, cryptoKey, signature, data);
43449
43544
  }
@@ -60258,7 +60353,7 @@ function escapeRegex(regex) {
60258
60353
  /*!**************************************!*\
60259
60354
  !*** ./node_modules/n3/src/index.js ***!
60260
60355
  \**************************************/
60261
- /*! exports provided: Lexer, Parser, Writer, Store, StreamParser, StreamWriter, Util, DataFactory, Term, NamedNode, Literal, BlankNode, Variable, DefaultGraph, Quad, Triple, termFromId, termToId */
60356
+ /*! exports provided: Lexer, Parser, Writer, Store, StreamParser, StreamWriter, Util, DataFactory, Term, NamedNode, Literal, BlankNode, Variable, DefaultGraph, Quad, Triple, termFromId, termToId, default */
60262
60357
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
60263
60358
 
60264
60359
  "use strict";
@@ -60316,7 +60411,33 @@ __webpack_require__.r(__webpack_exports__);
60316
60411
 
60317
60412
 
60318
60413
 
60414
+ // Named exports
60415
+
60319
60416
 
60417
+ // Export all named exports as a default object for backward compatibility
60418
+ /* harmony default export */ __webpack_exports__["default"] = ({
60419
+ Lexer: _N3Lexer__WEBPACK_IMPORTED_MODULE_0__["default"],
60420
+ Parser: _N3Parser__WEBPACK_IMPORTED_MODULE_1__["default"],
60421
+ Writer: _N3Writer__WEBPACK_IMPORTED_MODULE_2__["default"],
60422
+ Store: _N3Store__WEBPACK_IMPORTED_MODULE_3__["default"],
60423
+ StreamParser: _N3StreamParser__WEBPACK_IMPORTED_MODULE_4__["default"],
60424
+ StreamWriter: _N3StreamWriter__WEBPACK_IMPORTED_MODULE_5__["default"],
60425
+ Util: _N3Util__WEBPACK_IMPORTED_MODULE_6__,
60426
+
60427
+ DataFactory: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["default"],
60428
+
60429
+ Term: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Term"],
60430
+ NamedNode: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["NamedNode"],
60431
+ Literal: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Literal"],
60432
+ BlankNode: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["BlankNode"],
60433
+ Variable: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Variable"],
60434
+ DefaultGraph: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["DefaultGraph"],
60435
+ Quad: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Quad"],
60436
+ Triple: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Triple"],
60437
+
60438
+ termFromId: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["termFromId"],
60439
+ termToId: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["termToId"],
60440
+ });
60320
60441
 
60321
60442
 
60322
60443
  /***/ }),
@@ -60635,6 +60756,313 @@ var substr = 'ab'.substr(-1) === 'b'
60635
60756
 
60636
60757
  /***/ }),
60637
60758
 
60759
+ /***/ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js":
60760
+ /*!******************************************************************************************!*\
60761
+ !*** ./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js ***!
60762
+ \******************************************************************************************/
60763
+ /*! no static exports found */
60764
+ /***/ (function(module, exports, __webpack_require__) {
60765
+
60766
+ "use strict";
60767
+ // Copyright Joyent, Inc. and other Node contributors.
60768
+ //
60769
+ // Permission is hereby granted, free of charge, to any person obtaining a
60770
+ // copy of this software and associated documentation files (the
60771
+ // "Software"), to deal in the Software without restriction, including
60772
+ // without limitation the rights to use, copy, modify, merge, publish,
60773
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
60774
+ // persons to whom the Software is furnished to do so, subject to the
60775
+ // following conditions:
60776
+ //
60777
+ // The above copyright notice and this permission notice shall be included
60778
+ // in all copies or substantial portions of the Software.
60779
+ //
60780
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
60781
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60782
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
60783
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
60784
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
60785
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
60786
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
60787
+
60788
+
60789
+
60790
+ /*<replacement>*/
60791
+
60792
+ var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer;
60793
+ /*</replacement>*/
60794
+
60795
+ var isEncoding = Buffer.isEncoding || function (encoding) {
60796
+ encoding = '' + encoding;
60797
+ switch (encoding && encoding.toLowerCase()) {
60798
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
60799
+ return true;
60800
+ default:
60801
+ return false;
60802
+ }
60803
+ };
60804
+
60805
+ function _normalizeEncoding(enc) {
60806
+ if (!enc) return 'utf8';
60807
+ var retried;
60808
+ while (true) {
60809
+ switch (enc) {
60810
+ case 'utf8':
60811
+ case 'utf-8':
60812
+ return 'utf8';
60813
+ case 'ucs2':
60814
+ case 'ucs-2':
60815
+ case 'utf16le':
60816
+ case 'utf-16le':
60817
+ return 'utf16le';
60818
+ case 'latin1':
60819
+ case 'binary':
60820
+ return 'latin1';
60821
+ case 'base64':
60822
+ case 'ascii':
60823
+ case 'hex':
60824
+ return enc;
60825
+ default:
60826
+ if (retried) return; // undefined
60827
+ enc = ('' + enc).toLowerCase();
60828
+ retried = true;
60829
+ }
60830
+ }
60831
+ };
60832
+
60833
+ // Do not cache `Buffer.isEncoding` when checking encoding names as some
60834
+ // modules monkey-patch it to support additional encodings
60835
+ function normalizeEncoding(enc) {
60836
+ var nenc = _normalizeEncoding(enc);
60837
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
60838
+ return nenc || enc;
60839
+ }
60840
+
60841
+ // StringDecoder provides an interface for efficiently splitting a series of
60842
+ // buffers into a series of JS strings without breaking apart multi-byte
60843
+ // characters.
60844
+ exports.StringDecoder = StringDecoder;
60845
+ function StringDecoder(encoding) {
60846
+ this.encoding = normalizeEncoding(encoding);
60847
+ var nb;
60848
+ switch (this.encoding) {
60849
+ case 'utf16le':
60850
+ this.text = utf16Text;
60851
+ this.end = utf16End;
60852
+ nb = 4;
60853
+ break;
60854
+ case 'utf8':
60855
+ this.fillLast = utf8FillLast;
60856
+ nb = 4;
60857
+ break;
60858
+ case 'base64':
60859
+ this.text = base64Text;
60860
+ this.end = base64End;
60861
+ nb = 3;
60862
+ break;
60863
+ default:
60864
+ this.write = simpleWrite;
60865
+ this.end = simpleEnd;
60866
+ return;
60867
+ }
60868
+ this.lastNeed = 0;
60869
+ this.lastTotal = 0;
60870
+ this.lastChar = Buffer.allocUnsafe(nb);
60871
+ }
60872
+
60873
+ StringDecoder.prototype.write = function (buf) {
60874
+ if (buf.length === 0) return '';
60875
+ var r;
60876
+ var i;
60877
+ if (this.lastNeed) {
60878
+ r = this.fillLast(buf);
60879
+ if (r === undefined) return '';
60880
+ i = this.lastNeed;
60881
+ this.lastNeed = 0;
60882
+ } else {
60883
+ i = 0;
60884
+ }
60885
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
60886
+ return r || '';
60887
+ };
60888
+
60889
+ StringDecoder.prototype.end = utf8End;
60890
+
60891
+ // Returns only complete characters in a Buffer
60892
+ StringDecoder.prototype.text = utf8Text;
60893
+
60894
+ // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
60895
+ StringDecoder.prototype.fillLast = function (buf) {
60896
+ if (this.lastNeed <= buf.length) {
60897
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
60898
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
60899
+ }
60900
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
60901
+ this.lastNeed -= buf.length;
60902
+ };
60903
+
60904
+ // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
60905
+ // continuation byte. If an invalid byte is detected, -2 is returned.
60906
+ function utf8CheckByte(byte) {
60907
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
60908
+ return byte >> 6 === 0x02 ? -1 : -2;
60909
+ }
60910
+
60911
+ // Checks at most 3 bytes at the end of a Buffer in order to detect an
60912
+ // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
60913
+ // needed to complete the UTF-8 character (if applicable) are returned.
60914
+ function utf8CheckIncomplete(self, buf, i) {
60915
+ var j = buf.length - 1;
60916
+ if (j < i) return 0;
60917
+ var nb = utf8CheckByte(buf[j]);
60918
+ if (nb >= 0) {
60919
+ if (nb > 0) self.lastNeed = nb - 1;
60920
+ return nb;
60921
+ }
60922
+ if (--j < i || nb === -2) return 0;
60923
+ nb = utf8CheckByte(buf[j]);
60924
+ if (nb >= 0) {
60925
+ if (nb > 0) self.lastNeed = nb - 2;
60926
+ return nb;
60927
+ }
60928
+ if (--j < i || nb === -2) return 0;
60929
+ nb = utf8CheckByte(buf[j]);
60930
+ if (nb >= 0) {
60931
+ if (nb > 0) {
60932
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
60933
+ }
60934
+ return nb;
60935
+ }
60936
+ return 0;
60937
+ }
60938
+
60939
+ // Validates as many continuation bytes for a multi-byte UTF-8 character as
60940
+ // needed or are available. If we see a non-continuation byte where we expect
60941
+ // one, we "replace" the validated continuation bytes we've seen so far with
60942
+ // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
60943
+ // behavior. The continuation byte check is included three times in the case
60944
+ // where all of the continuation bytes for a character exist in the same buffer.
60945
+ // It is also done this way as a slight performance increase instead of using a
60946
+ // loop.
60947
+ function utf8CheckExtraBytes(self, buf, p) {
60948
+ if ((buf[0] & 0xC0) !== 0x80) {
60949
+ self.lastNeed = 0;
60950
+ return '\ufffd';
60951
+ }
60952
+ if (self.lastNeed > 1 && buf.length > 1) {
60953
+ if ((buf[1] & 0xC0) !== 0x80) {
60954
+ self.lastNeed = 1;
60955
+ return '\ufffd';
60956
+ }
60957
+ if (self.lastNeed > 2 && buf.length > 2) {
60958
+ if ((buf[2] & 0xC0) !== 0x80) {
60959
+ self.lastNeed = 2;
60960
+ return '\ufffd';
60961
+ }
60962
+ }
60963
+ }
60964
+ }
60965
+
60966
+ // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
60967
+ function utf8FillLast(buf) {
60968
+ var p = this.lastTotal - this.lastNeed;
60969
+ var r = utf8CheckExtraBytes(this, buf, p);
60970
+ if (r !== undefined) return r;
60971
+ if (this.lastNeed <= buf.length) {
60972
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
60973
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
60974
+ }
60975
+ buf.copy(this.lastChar, p, 0, buf.length);
60976
+ this.lastNeed -= buf.length;
60977
+ }
60978
+
60979
+ // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
60980
+ // partial character, the character's bytes are buffered until the required
60981
+ // number of bytes are available.
60982
+ function utf8Text(buf, i) {
60983
+ var total = utf8CheckIncomplete(this, buf, i);
60984
+ if (!this.lastNeed) return buf.toString('utf8', i);
60985
+ this.lastTotal = total;
60986
+ var end = buf.length - (total - this.lastNeed);
60987
+ buf.copy(this.lastChar, 0, end);
60988
+ return buf.toString('utf8', i, end);
60989
+ }
60990
+
60991
+ // For UTF-8, a replacement character is added when ending on a partial
60992
+ // character.
60993
+ function utf8End(buf) {
60994
+ var r = buf && buf.length ? this.write(buf) : '';
60995
+ if (this.lastNeed) return r + '\ufffd';
60996
+ return r;
60997
+ }
60998
+
60999
+ // UTF-16LE typically needs two bytes per character, but even if we have an even
61000
+ // number of bytes available, we need to check if we end on a leading/high
61001
+ // surrogate. In that case, we need to wait for the next two bytes in order to
61002
+ // decode the last character properly.
61003
+ function utf16Text(buf, i) {
61004
+ if ((buf.length - i) % 2 === 0) {
61005
+ var r = buf.toString('utf16le', i);
61006
+ if (r) {
61007
+ var c = r.charCodeAt(r.length - 1);
61008
+ if (c >= 0xD800 && c <= 0xDBFF) {
61009
+ this.lastNeed = 2;
61010
+ this.lastTotal = 4;
61011
+ this.lastChar[0] = buf[buf.length - 2];
61012
+ this.lastChar[1] = buf[buf.length - 1];
61013
+ return r.slice(0, -1);
61014
+ }
61015
+ }
61016
+ return r;
61017
+ }
61018
+ this.lastNeed = 1;
61019
+ this.lastTotal = 2;
61020
+ this.lastChar[0] = buf[buf.length - 1];
61021
+ return buf.toString('utf16le', i, buf.length - 1);
61022
+ }
61023
+
61024
+ // For UTF-16LE we do not explicitly append special replacement characters if we
61025
+ // end on a partial character, we simply let v8 handle that.
61026
+ function utf16End(buf) {
61027
+ var r = buf && buf.length ? this.write(buf) : '';
61028
+ if (this.lastNeed) {
61029
+ var end = this.lastTotal - this.lastNeed;
61030
+ return r + this.lastChar.toString('utf16le', 0, end);
61031
+ }
61032
+ return r;
61033
+ }
61034
+
61035
+ function base64Text(buf, i) {
61036
+ var n = (buf.length - i) % 3;
61037
+ if (n === 0) return buf.toString('base64', i);
61038
+ this.lastNeed = 3 - n;
61039
+ this.lastTotal = 3;
61040
+ if (n === 1) {
61041
+ this.lastChar[0] = buf[buf.length - 1];
61042
+ } else {
61043
+ this.lastChar[0] = buf[buf.length - 2];
61044
+ this.lastChar[1] = buf[buf.length - 1];
61045
+ }
61046
+ return buf.toString('base64', i, buf.length - n);
61047
+ }
61048
+
61049
+ function base64End(buf) {
61050
+ var r = buf && buf.length ? this.write(buf) : '';
61051
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
61052
+ return r;
61053
+ }
61054
+
61055
+ // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
61056
+ function simpleWrite(buf) {
61057
+ return buf.toString(this.encoding);
61058
+ }
61059
+
61060
+ function simpleEnd(buf) {
61061
+ return buf && buf.length ? this.write(buf) : '';
61062
+ }
61063
+
61064
+ /***/ }),
61065
+
60638
61066
  /***/ "./node_modules/process/browser.js":
60639
61067
  /*!*****************************************!*\
60640
61068
  !*** ./node_modules/process/browser.js ***!
@@ -79702,7 +80130,7 @@ function ReadableState(options, stream, isDuplex) {
79702
80130
  this.encoding = null;
79703
80131
 
79704
80132
  if (options.encoding) {
79705
- if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
80133
+ if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
79706
80134
  this.decoder = new StringDecoder(options.encoding);
79707
80135
  this.encoding = options.encoding;
79708
80136
  }
@@ -79864,7 +80292,7 @@ Readable.prototype.isPaused = function () {
79864
80292
 
79865
80293
 
79866
80294
  Readable.prototype.setEncoding = function (enc) {
79867
- if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
80295
+ if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
79868
80296
  var decoder = new StringDecoder(enc);
79869
80297
  this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
79870
80298
 
@@ -83225,7 +83653,6 @@ try {
83225
83653
  /*! no static exports found */
83226
83654
  /***/ (function(module, exports, __webpack_require__) {
83227
83655
 
83228
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
83229
83656
  /* eslint-disable node/no-deprecated-api */
83230
83657
  var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")
83231
83658
  var Buffer = buffer.Buffer
@@ -83248,8 +83675,6 @@ function SafeBuffer (arg, encodingOrOffset, length) {
83248
83675
  return Buffer(arg, encodingOrOffset, length)
83249
83676
  }
83250
83677
 
83251
- SafeBuffer.prototype = Object.create(Buffer.prototype)
83252
-
83253
83678
  // Copy static methods from Buffer
83254
83679
  copyProps(Buffer, SafeBuffer)
83255
83680
 
@@ -83733,9 +84158,6 @@ exports.SolidAuthnLogic = void 0;
83733
84158
  var rdflib_1 = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js");
83734
84159
  var authUtil_1 = __webpack_require__(/*! ./authUtil */ "./node_modules/solid-logic/lib/authn/authUtil.js");
83735
84160
  var debug = __importStar(__webpack_require__(/*! ../util/debug */ "./node_modules/solid-logic/lib/util/debug.js"));
83736
- /**
83737
- * Implements AuthnLogic relying on solid-auth-client
83738
- */
83739
84161
  var SolidAuthnLogic = /** @class */ (function () {
83740
84162
  function SolidAuthnLogic(solidAuthSession) {
83741
84163
  this.session = solidAuthSession;
@@ -84548,12 +84970,8 @@ var SolidLogic = /** @class */ (function () {
84548
84970
  preferencesFile: {},
84549
84971
  };
84550
84972
  this.fetcher = fetcher;
84551
- // if (authSession) {
84552
84973
  this.authn = new SolidAuthnLogic_1.SolidAuthnLogic(session);
84553
84974
  debug.log('SolidAuthnLogic initialized');
84554
- /* } else {
84555
- this.authn = new NoAuthnLogic();
84556
- }*/
84557
84975
  this.profile = new ProfileLogic_1.ProfileLogic(this.store, ns, this.authn);
84558
84976
  this.chat = new ChatLogic_1.ChatLogic(this.store, ns, this.profile);
84559
84977
  this.util = new UtilityLogic_1.UtilityLogic(this.store, ns, this.fetcher);
@@ -85719,313 +86137,6 @@ function vocab (rdf = { namedNode: u => u }) {
85719
86137
  module.exports = vocab
85720
86138
 
85721
86139
 
85722
- /***/ }),
85723
-
85724
- /***/ "./node_modules/string_decoder/lib/string_decoder.js":
85725
- /*!***********************************************************!*\
85726
- !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
85727
- \***********************************************************/
85728
- /*! no static exports found */
85729
- /***/ (function(module, exports, __webpack_require__) {
85730
-
85731
- "use strict";
85732
- // Copyright Joyent, Inc. and other Node contributors.
85733
- //
85734
- // Permission is hereby granted, free of charge, to any person obtaining a
85735
- // copy of this software and associated documentation files (the
85736
- // "Software"), to deal in the Software without restriction, including
85737
- // without limitation the rights to use, copy, modify, merge, publish,
85738
- // distribute, sublicense, and/or sell copies of the Software, and to permit
85739
- // persons to whom the Software is furnished to do so, subject to the
85740
- // following conditions:
85741
- //
85742
- // The above copyright notice and this permission notice shall be included
85743
- // in all copies or substantial portions of the Software.
85744
- //
85745
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
85746
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
85747
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
85748
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
85749
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
85750
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
85751
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
85752
-
85753
-
85754
-
85755
- /*<replacement>*/
85756
-
85757
- var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer;
85758
- /*</replacement>*/
85759
-
85760
- var isEncoding = Buffer.isEncoding || function (encoding) {
85761
- encoding = '' + encoding;
85762
- switch (encoding && encoding.toLowerCase()) {
85763
- case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
85764
- return true;
85765
- default:
85766
- return false;
85767
- }
85768
- };
85769
-
85770
- function _normalizeEncoding(enc) {
85771
- if (!enc) return 'utf8';
85772
- var retried;
85773
- while (true) {
85774
- switch (enc) {
85775
- case 'utf8':
85776
- case 'utf-8':
85777
- return 'utf8';
85778
- case 'ucs2':
85779
- case 'ucs-2':
85780
- case 'utf16le':
85781
- case 'utf-16le':
85782
- return 'utf16le';
85783
- case 'latin1':
85784
- case 'binary':
85785
- return 'latin1';
85786
- case 'base64':
85787
- case 'ascii':
85788
- case 'hex':
85789
- return enc;
85790
- default:
85791
- if (retried) return; // undefined
85792
- enc = ('' + enc).toLowerCase();
85793
- retried = true;
85794
- }
85795
- }
85796
- };
85797
-
85798
- // Do not cache `Buffer.isEncoding` when checking encoding names as some
85799
- // modules monkey-patch it to support additional encodings
85800
- function normalizeEncoding(enc) {
85801
- var nenc = _normalizeEncoding(enc);
85802
- if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
85803
- return nenc || enc;
85804
- }
85805
-
85806
- // StringDecoder provides an interface for efficiently splitting a series of
85807
- // buffers into a series of JS strings without breaking apart multi-byte
85808
- // characters.
85809
- exports.StringDecoder = StringDecoder;
85810
- function StringDecoder(encoding) {
85811
- this.encoding = normalizeEncoding(encoding);
85812
- var nb;
85813
- switch (this.encoding) {
85814
- case 'utf16le':
85815
- this.text = utf16Text;
85816
- this.end = utf16End;
85817
- nb = 4;
85818
- break;
85819
- case 'utf8':
85820
- this.fillLast = utf8FillLast;
85821
- nb = 4;
85822
- break;
85823
- case 'base64':
85824
- this.text = base64Text;
85825
- this.end = base64End;
85826
- nb = 3;
85827
- break;
85828
- default:
85829
- this.write = simpleWrite;
85830
- this.end = simpleEnd;
85831
- return;
85832
- }
85833
- this.lastNeed = 0;
85834
- this.lastTotal = 0;
85835
- this.lastChar = Buffer.allocUnsafe(nb);
85836
- }
85837
-
85838
- StringDecoder.prototype.write = function (buf) {
85839
- if (buf.length === 0) return '';
85840
- var r;
85841
- var i;
85842
- if (this.lastNeed) {
85843
- r = this.fillLast(buf);
85844
- if (r === undefined) return '';
85845
- i = this.lastNeed;
85846
- this.lastNeed = 0;
85847
- } else {
85848
- i = 0;
85849
- }
85850
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
85851
- return r || '';
85852
- };
85853
-
85854
- StringDecoder.prototype.end = utf8End;
85855
-
85856
- // Returns only complete characters in a Buffer
85857
- StringDecoder.prototype.text = utf8Text;
85858
-
85859
- // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
85860
- StringDecoder.prototype.fillLast = function (buf) {
85861
- if (this.lastNeed <= buf.length) {
85862
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
85863
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
85864
- }
85865
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
85866
- this.lastNeed -= buf.length;
85867
- };
85868
-
85869
- // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
85870
- // continuation byte. If an invalid byte is detected, -2 is returned.
85871
- function utf8CheckByte(byte) {
85872
- if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
85873
- return byte >> 6 === 0x02 ? -1 : -2;
85874
- }
85875
-
85876
- // Checks at most 3 bytes at the end of a Buffer in order to detect an
85877
- // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
85878
- // needed to complete the UTF-8 character (if applicable) are returned.
85879
- function utf8CheckIncomplete(self, buf, i) {
85880
- var j = buf.length - 1;
85881
- if (j < i) return 0;
85882
- var nb = utf8CheckByte(buf[j]);
85883
- if (nb >= 0) {
85884
- if (nb > 0) self.lastNeed = nb - 1;
85885
- return nb;
85886
- }
85887
- if (--j < i || nb === -2) return 0;
85888
- nb = utf8CheckByte(buf[j]);
85889
- if (nb >= 0) {
85890
- if (nb > 0) self.lastNeed = nb - 2;
85891
- return nb;
85892
- }
85893
- if (--j < i || nb === -2) return 0;
85894
- nb = utf8CheckByte(buf[j]);
85895
- if (nb >= 0) {
85896
- if (nb > 0) {
85897
- if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
85898
- }
85899
- return nb;
85900
- }
85901
- return 0;
85902
- }
85903
-
85904
- // Validates as many continuation bytes for a multi-byte UTF-8 character as
85905
- // needed or are available. If we see a non-continuation byte where we expect
85906
- // one, we "replace" the validated continuation bytes we've seen so far with
85907
- // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
85908
- // behavior. The continuation byte check is included three times in the case
85909
- // where all of the continuation bytes for a character exist in the same buffer.
85910
- // It is also done this way as a slight performance increase instead of using a
85911
- // loop.
85912
- function utf8CheckExtraBytes(self, buf, p) {
85913
- if ((buf[0] & 0xC0) !== 0x80) {
85914
- self.lastNeed = 0;
85915
- return '\ufffd';
85916
- }
85917
- if (self.lastNeed > 1 && buf.length > 1) {
85918
- if ((buf[1] & 0xC0) !== 0x80) {
85919
- self.lastNeed = 1;
85920
- return '\ufffd';
85921
- }
85922
- if (self.lastNeed > 2 && buf.length > 2) {
85923
- if ((buf[2] & 0xC0) !== 0x80) {
85924
- self.lastNeed = 2;
85925
- return '\ufffd';
85926
- }
85927
- }
85928
- }
85929
- }
85930
-
85931
- // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
85932
- function utf8FillLast(buf) {
85933
- var p = this.lastTotal - this.lastNeed;
85934
- var r = utf8CheckExtraBytes(this, buf, p);
85935
- if (r !== undefined) return r;
85936
- if (this.lastNeed <= buf.length) {
85937
- buf.copy(this.lastChar, p, 0, this.lastNeed);
85938
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
85939
- }
85940
- buf.copy(this.lastChar, p, 0, buf.length);
85941
- this.lastNeed -= buf.length;
85942
- }
85943
-
85944
- // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
85945
- // partial character, the character's bytes are buffered until the required
85946
- // number of bytes are available.
85947
- function utf8Text(buf, i) {
85948
- var total = utf8CheckIncomplete(this, buf, i);
85949
- if (!this.lastNeed) return buf.toString('utf8', i);
85950
- this.lastTotal = total;
85951
- var end = buf.length - (total - this.lastNeed);
85952
- buf.copy(this.lastChar, 0, end);
85953
- return buf.toString('utf8', i, end);
85954
- }
85955
-
85956
- // For UTF-8, a replacement character is added when ending on a partial
85957
- // character.
85958
- function utf8End(buf) {
85959
- var r = buf && buf.length ? this.write(buf) : '';
85960
- if (this.lastNeed) return r + '\ufffd';
85961
- return r;
85962
- }
85963
-
85964
- // UTF-16LE typically needs two bytes per character, but even if we have an even
85965
- // number of bytes available, we need to check if we end on a leading/high
85966
- // surrogate. In that case, we need to wait for the next two bytes in order to
85967
- // decode the last character properly.
85968
- function utf16Text(buf, i) {
85969
- if ((buf.length - i) % 2 === 0) {
85970
- var r = buf.toString('utf16le', i);
85971
- if (r) {
85972
- var c = r.charCodeAt(r.length - 1);
85973
- if (c >= 0xD800 && c <= 0xDBFF) {
85974
- this.lastNeed = 2;
85975
- this.lastTotal = 4;
85976
- this.lastChar[0] = buf[buf.length - 2];
85977
- this.lastChar[1] = buf[buf.length - 1];
85978
- return r.slice(0, -1);
85979
- }
85980
- }
85981
- return r;
85982
- }
85983
- this.lastNeed = 1;
85984
- this.lastTotal = 2;
85985
- this.lastChar[0] = buf[buf.length - 1];
85986
- return buf.toString('utf16le', i, buf.length - 1);
85987
- }
85988
-
85989
- // For UTF-16LE we do not explicitly append special replacement characters if we
85990
- // end on a partial character, we simply let v8 handle that.
85991
- function utf16End(buf) {
85992
- var r = buf && buf.length ? this.write(buf) : '';
85993
- if (this.lastNeed) {
85994
- var end = this.lastTotal - this.lastNeed;
85995
- return r + this.lastChar.toString('utf16le', 0, end);
85996
- }
85997
- return r;
85998
- }
85999
-
86000
- function base64Text(buf, i) {
86001
- var n = (buf.length - i) % 3;
86002
- if (n === 0) return buf.toString('base64', i);
86003
- this.lastNeed = 3 - n;
86004
- this.lastTotal = 3;
86005
- if (n === 1) {
86006
- this.lastChar[0] = buf[buf.length - 1];
86007
- } else {
86008
- this.lastChar[0] = buf[buf.length - 2];
86009
- this.lastChar[1] = buf[buf.length - 1];
86010
- }
86011
- return buf.toString('base64', i, buf.length - n);
86012
- }
86013
-
86014
- function base64End(buf) {
86015
- var r = buf && buf.length ? this.write(buf) : '';
86016
- if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
86017
- return r;
86018
- }
86019
-
86020
- // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
86021
- function simpleWrite(buf) {
86022
- return buf.toString(this.encoding);
86023
- }
86024
-
86025
- function simpleEnd(buf) {
86026
- return buf && buf.length ? this.write(buf) : '';
86027
- }
86028
-
86029
86140
  /***/ }),
86030
86141
 
86031
86142
  /***/ "./node_modules/symbol-observable/es/index.js":