@simulacrum/auth0-simulator 0.11.0 → 0.11.2

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.
package/dist/index.cjs CHANGED
@@ -77,8 +77,7 @@ const convertToObj = (arrayOfObjects, key$1 = "id") => arrayOfObjects.reduce((fi
77
77
  }, {});
78
78
  const convertInitialStateToStoreState = (initialState) => {
79
79
  if (!initialState) return void 0;
80
- const storeObject = { users: convertToObj(initialState.users, "id") };
81
- return storeObject;
80
+ return { users: convertToObj(initialState.users, "id") };
82
81
  };
83
82
 
84
83
  //#endregion
@@ -86,31 +85,35 @@ const convertInitialStateToStoreState = (initialState) => {
86
85
  const inputSchema = (initialState, extendedSchema) => ({ slice: slice$3 }) => {
87
86
  const storeInitialState = convertInitialStateToStoreState(initialState);
88
87
  const extended = extendedSchema ? extendedSchema({ slice: slice$3 }) : {};
89
- let slices = {
88
+ return {
90
89
  sessions: slice$3.table(),
91
90
  users: slice$3.table({ ...!storeInitialState ? { initialState: { [defaultUser.id]: defaultUser } } : { initialState: storeInitialState.users } }),
92
91
  ...extended
93
92
  };
94
- return slices;
95
93
  };
96
- const inputActions = (args) => {
94
+ const inputActions = (_args) => {
97
95
  return {};
98
96
  };
99
97
  const extendActions = (extendedActions) => (args) => {
100
- return extendedActions ? {
101
- ...inputActions(args),
102
- ...extendedActions(args)
103
- } : inputActions(args);
98
+ const base = inputActions(args);
99
+ if (!extendedActions) return base;
100
+ const extResult = extendedActions(args);
101
+ return {
102
+ ...base,
103
+ ...extResult
104
+ };
104
105
  };
105
- const inputSelectors = (args) => {
106
- const { createSelector, schema } = args;
106
+ const inputSelectors = (_args) => {
107
107
  return {};
108
108
  };
109
109
  const extendSelectors = (extendedSelectors) => (args) => {
110
- return extendedSelectors ? {
111
- ...inputSelectors(args),
112
- ...extendedSelectors(args)
113
- } : inputSelectors(args);
110
+ const base = inputSelectors(args);
111
+ if (!extendedSelectors) return base;
112
+ const extResult = extendedSelectors(args);
113
+ return {
114
+ ...base,
115
+ ...extResult
116
+ };
114
117
  };
115
118
  const extendStore = (initialState, extended) => ({
116
119
  actions: extendActions(extended?.actions),
@@ -189,9 +192,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
189
192
  */
190
193
  function depd(namespace) {
191
194
  if (!namespace) throw new TypeError("argument namespace is required");
192
- var stack = getStack();
193
- var site = callSiteLocation(stack[1]);
194
- var file = site[0];
195
+ var file = callSiteLocation(getStack()[1])[0];
195
196
  function deprecate$3(message) {
196
197
  log$1.call(deprecate$3, message);
197
198
  }
@@ -216,24 +217,21 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
216
217
  * @private
217
218
  */
218
219
  function eehaslisteners(emitter, type) {
219
- var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type);
220
- return count > 0;
220
+ return (typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type)) > 0;
221
221
  }
222
222
  /**
223
223
  * Determine if namespace is ignored.
224
224
  */
225
225
  function isignored(namespace) {
226
226
  if (process.noDeprecation) return true;
227
- var str = process.env.NO_DEPRECATION || "";
228
- return containsNamespace(str, namespace);
227
+ return containsNamespace(process.env.NO_DEPRECATION || "", namespace);
229
228
  }
230
229
  /**
231
230
  * Determine if namespace is traced.
232
231
  */
233
232
  function istraced(namespace) {
234
233
  if (process.traceDeprecation) return true;
235
- var str = process.env.TRACE_DEPRECATION || "";
236
- return containsNamespace(str, namespace);
234
+ return containsNamespace(process.env.TRACE_DEPRECATION || "", namespace);
237
235
  }
238
236
  /**
239
237
  * Display deprecation message.
@@ -276,8 +274,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
276
274
  process.emit("deprecation", err);
277
275
  return;
278
276
  }
279
- var format$4 = process.stderr.isTTY ? formatColor : formatPlain;
280
- var output = format$4.call(this, msg, caller, stack.slice(i$6));
277
+ var output = (process.stderr.isTTY ? formatColor : formatPlain).call(this, msg, caller, stack.slice(i$6));
281
278
  process.stderr.write(output + "\n", "utf8");
282
279
  }
283
280
  /**
@@ -314,8 +311,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
314
311
  * Format deprecation message without color.
315
312
  */
316
313
  function formatPlain(msg, caller, stack) {
317
- var timestamp = (/* @__PURE__ */ new Date()).toUTCString();
318
- var formatted = timestamp + " " + this._namespace + " deprecated " + msg;
314
+ var formatted = (/* @__PURE__ */ new Date()).toUTCString() + " " + this._namespace + " deprecated " + msg;
319
315
  if (this._traced) {
320
316
  for (var i$6 = 0; i$6 < stack.length; i$6++) formatted += "\n at " + stack[i$6].toString();
321
317
  return formatted;
@@ -368,11 +364,9 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
368
364
  function wrapfunction(fn, message) {
369
365
  if (typeof fn !== "function") throw new TypeError("argument fn must be a function");
370
366
  var args = createArgumentsString(fn.length);
371
- var stack = getStack();
372
- var site = callSiteLocation(stack[1]);
367
+ var site = callSiteLocation(getStack()[1]);
373
368
  site.name = fn.name;
374
- var deprecatedfn = new Function("fn", "log", "deprecate", "message", "site", "\"use strict\"\nreturn function (" + args + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn, log$1, this, message, site);
375
- return deprecatedfn;
369
+ return new Function("fn", "log", "deprecate", "message", "site", "\"use strict\"\nreturn function (" + args + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn, log$1, this, message, site);
376
370
  }
377
371
  /**
378
372
  * Wrap property in a deprecation message.
@@ -383,8 +377,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
383
377
  if (!descriptor) throw new TypeError("must call property on owner object");
384
378
  if (!descriptor.configurable) throw new TypeError("property must be configurable");
385
379
  var deprecate$3 = this;
386
- var stack = getStack();
387
- var site = callSiteLocation(stack[1]);
380
+ var site = callSiteLocation(getStack()[1]);
388
381
  site.name = prop;
389
382
  if ("value" in descriptor) descriptor = convertDataDescriptorToAccessor(obj, prop, message);
390
383
  var get = descriptor.get;
@@ -916,8 +909,7 @@ var require_ms = /* @__PURE__ */ __commonJS({ "../../node_modules/ms/index.js":
916
909
  var match$1 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
917
910
  if (!match$1) return;
918
911
  var n = parseFloat(match$1[1]);
919
- var type = (match$1[2] || "ms").toLowerCase();
920
- switch (type) {
912
+ switch ((match$1[2] || "ms").toLowerCase()) {
921
913
  case "years":
922
914
  case "year":
923
915
  case "yrs":
@@ -949,7 +941,7 @@ var require_ms = /* @__PURE__ */ __commonJS({ "../../node_modules/ms/index.js":
949
941
  case "msecs":
950
942
  case "msec":
951
943
  case "ms": return n;
952
- default: return void 0;
944
+ default: return;
953
945
  }
954
946
  }
955
947
  /**
@@ -1052,8 +1044,7 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/
1052
1044
  if (!debug$11.enabled) return;
1053
1045
  const self = debug$11;
1054
1046
  const curr = Number(/* @__PURE__ */ new Date());
1055
- const ms$1 = curr - (prevTime || curr);
1056
- self.diff = ms$1;
1047
+ self.diff = curr - (prevTime || curr);
1057
1048
  self.prev = prevTime;
1058
1049
  self.curr = curr;
1059
1050
  prevTime = curr;
@@ -1073,8 +1064,7 @@ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/debug/src/
1073
1064
  return match$1;
1074
1065
  });
1075
1066
  createDebug.formatArgs.call(self, args);
1076
- const logFn = self.log || createDebug.log;
1077
- logFn.apply(self, args);
1067
+ (self.log || createDebug.log).apply(self, args);
1078
1068
  }
1079
1069
  debug$11.namespace = namespace;
1080
1070
  debug$11.useColors = createDebug.useColors();
@@ -1446,7 +1436,7 @@ var require_supports_color = /* @__PURE__ */ __commonJS({ "../../node_modules/su
1446
1436
  "GITLAB_CI",
1447
1437
  "GITHUB_ACTIONS",
1448
1438
  "BUILDKITE"
1449
- ].some((sign$3) => sign$3 in env) || env.CI_NAME === "codeship") return 1;
1439
+ ].some((sign$2) => sign$2 in env) || env.CI_NAME === "codeship") return 1;
1450
1440
  return min$1;
1451
1441
  }
1452
1442
  if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
@@ -1464,8 +1454,7 @@ var require_supports_color = /* @__PURE__ */ __commonJS({ "../../node_modules/su
1464
1454
  return min$1;
1465
1455
  }
1466
1456
  function getSupportLevel(stream) {
1467
- const level = supportsColor(stream, stream && stream.isTTY);
1468
- return translateLevel(level);
1457
+ return translateLevel(supportsColor(stream, stream && stream.isTTY));
1469
1458
  }
1470
1459
  module.exports = {
1471
1460
  supportsColor: getSupportLevel,
@@ -1809,7 +1798,6 @@ var require_on_finished = /* @__PURE__ */ __commonJS({ "../../node_modules/on-fi
1809
1798
  var socket = msg.socket;
1810
1799
  if (typeof msg.finished === "boolean") return Boolean(msg.finished || socket && !socket.writable);
1811
1800
  if (typeof msg.complete === "boolean") return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable);
1812
- return void 0;
1813
1801
  }
1814
1802
  /**
1815
1803
  * Attach a finished listener to the message.
@@ -2000,8 +1988,7 @@ var require_bytes = /* @__PURE__ */ __commonJS({ "../../node_modules/bytes/index
2000
1988
  else if (mag >= map.mb) unit = "MB";
2001
1989
  else if (mag >= map.kb) unit = "KB";
2002
1990
  else unit = "B";
2003
- var val = value / map[unit.toLowerCase()];
2004
- var str = val.toFixed(decimalPlaces);
1991
+ var str = (value / map[unit.toLowerCase()]).toFixed(decimalPlaces);
2005
1992
  if (!fixedDecimals) str = str.replace(formatDecimalsRegExp, "$1");
2006
1993
  if (thousandsSeparator) str = str.split(".").map(function(s$1, i$6) {
2007
1994
  return i$6 === 0 ? s$1.replace(formatThousandsRegExp, thousandsSeparator) : s$1;
@@ -10964,10 +10951,7 @@ var require_raw_body = /* @__PURE__ */ __commonJS({ "../../node_modules/raw-body
10964
10951
  received,
10965
10952
  type: "request.size.invalid"
10966
10953
  }));
10967
- else {
10968
- var string = decoder ? buffer$2 + (decoder.end() || "") : Buffer.concat(buffer$2);
10969
- done(null, string);
10970
- }
10954
+ else done(null, decoder ? buffer$2 + (decoder.end() || "") : Buffer.concat(buffer$2));
10971
10955
  }
10972
10956
  function cleanup() {
10973
10957
  buffer$2 = null;
@@ -27567,8 +27551,7 @@ var require_mimeScore = /* @__PURE__ */ __commonJS({ "../../node_modules/mime-ty
27567
27551
  module.exports = function mimeScore$1(mimeType, source = "default") {
27568
27552
  if (mimeType === "application/octet-stream") return 0;
27569
27553
  const [type, subtype] = mimeType.split("/");
27570
- const facet = subtype.replace(/(\.|x-).*/, "$1");
27571
- const facetScore = FACET_SCORES[facet] || FACET_SCORES.default;
27554
+ const facetScore = FACET_SCORES[subtype.replace(/(\.|x-).*/, "$1")] || FACET_SCORES.default;
27572
27555
  const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default;
27573
27556
  const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default;
27574
27557
  const lengthScore = 1 - mimeType.length / 100;
@@ -27666,8 +27649,7 @@ var require_mime_types = /* @__PURE__ */ __commonJS({ "../../node_modules/mime-t
27666
27649
  */
27667
27650
  function populateMaps(extensions, types) {
27668
27651
  Object.keys(db).forEach(function forEachMimeType(type) {
27669
- var mime$5 = db[type];
27670
- var exts = mime$5.extensions;
27652
+ var exts = db[type].extensions;
27671
27653
  if (!exts || !exts.length) return;
27672
27654
  extensions[type] = exts;
27673
27655
  for (var i$6 = 0; i$6 < exts.length; i$6++) {
@@ -27683,9 +27665,7 @@ var require_mime_types = /* @__PURE__ */ __commonJS({ "../../node_modules/mime-t
27683
27665
  });
27684
27666
  }
27685
27667
  function _preferredType(ext, type0, type1) {
27686
- var score0 = type0 ? mimeScore(type0, db[type0].source) : 0;
27687
- var score1 = type1 ? mimeScore(type1, db[type1].source) : 0;
27688
- return score0 > score1 ? type0 : type1;
27668
+ return (type0 ? mimeScore(type0, db[type0].source) : 0) > (type1 ? mimeScore(type1, db[type1].source) : 0) ? type0 : type1;
27689
27669
  }
27690
27670
  function _preferredTypeLegacy(ext, type0, type1) {
27691
27671
  var SOURCE_RANK = [
@@ -27984,7 +27964,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/body-pars
27984
27964
  try {
27985
27965
  return (contentType$1.parse(req$2).parameters.charset || "").toLowerCase();
27986
27966
  } catch {
27987
- return void 0;
27967
+ return;
27988
27968
  }
27989
27969
  }
27990
27970
  /**
@@ -28012,12 +27992,11 @@ var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/body-pars
28012
27992
  var type = options?.type || defaultType;
28013
27993
  var verify = options?.verify || false;
28014
27994
  if (verify !== false && typeof verify !== "function") throw new TypeError("option verify must be function");
28015
- var shouldParse = typeof type !== "function" ? typeChecker(type) : type;
28016
27995
  return {
28017
27996
  inflate,
28018
27997
  limit: limit$1,
28019
27998
  verify,
28020
- shouldParse
27999
+ shouldParse: typeof type !== "function" ? typeChecker(type) : type
28021
28000
  };
28022
28001
  }
28023
28002
  }) });
@@ -28276,9 +28255,8 @@ var require_text = /* @__PURE__ */ __commonJS({ "../../node_modules/body-parser/
28276
28255
  next();
28277
28256
  return;
28278
28257
  }
28279
- var charset$1 = getCharset$1(req$2) || defaultCharset;
28280
28258
  read$1(req$2, res$2, next, parse$12, debug$8, {
28281
- encoding: charset$1,
28259
+ encoding: getCharset$1(req$2) || defaultCharset,
28282
28260
  inflate,
28283
28261
  limit: limit$1,
28284
28262
  verify
@@ -28311,12 +28289,9 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
28311
28289
  var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
28312
28290
  var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
28313
28291
  var setForEach = hasSet && Set.prototype.forEach;
28314
- var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
28315
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
28316
- var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
28317
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
28318
- var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
28319
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
28292
+ var weakMapHas = typeof WeakMap === "function" && WeakMap.prototype ? WeakMap.prototype.has : null;
28293
+ var weakSetHas = typeof WeakSet === "function" && WeakSet.prototype ? WeakSet.prototype.has : null;
28294
+ var weakRefDeref = typeof WeakRef === "function" && WeakRef.prototype ? WeakRef.prototype.deref : null;
28320
28295
  var booleanValueOf = Boolean.prototype.valueOf;
28321
28296
  var objectToString = Object.prototype.toString;
28322
28297
  var functionToString = Function.prototype.toString;
@@ -28467,8 +28442,7 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
28467
28442
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
28468
28443
  var protoTag = obj instanceof Object ? "" : "null prototype";
28469
28444
  var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
28470
- var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
28471
- var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
28445
+ var tag = (isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "") + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
28472
28446
  if (ys.length === 0) return tag + "{}";
28473
28447
  if (indent) return tag + "{" + indentedJoin(ys, indent) + "}";
28474
28448
  return tag + "{ " + $join.call(ys, ", ") + " }";
@@ -28476,8 +28450,7 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
28476
28450
  return String(obj);
28477
28451
  };
28478
28452
  function wrapQuotes(s$1, defaultStyle, opts) {
28479
- var style = opts.quoteStyle || defaultStyle;
28480
- var quoteChar = quotes[style];
28453
+ var quoteChar = quotes[opts.quoteStyle || defaultStyle];
28481
28454
  return quoteChar + s$1 + quoteChar;
28482
28455
  }
28483
28456
  function quote(s$1) {
@@ -28618,8 +28591,7 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
28618
28591
  }
28619
28592
  var quoteRE = quoteREs[opts.quoteStyle || "single"];
28620
28593
  quoteRE.lastIndex = 0;
28621
- var s$1 = $replace$1.call($replace$1.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte);
28622
- return wrapQuotes(s$1, "single", opts);
28594
+ return wrapQuotes($replace$1.call($replace$1.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte), "single", opts);
28623
28595
  }
28624
28596
  function lowbyte(c) {
28625
28597
  var n = c.charCodeAt(0);
@@ -28711,7 +28683,7 @@ var require_side_channel_list = /* @__PURE__ */ __commonJS({ "../../node_modules
28711
28683
  };
28712
28684
  /** @type {import('./list.d.ts').listGet} */
28713
28685
  var listGet = function(objects, key$1) {
28714
- if (!objects) return void 0;
28686
+ if (!objects) return;
28715
28687
  var node = listGetNode(objects, key$1);
28716
28688
  return node && node.value;
28717
28689
  };
@@ -28871,7 +28843,7 @@ var require_isNaN = /* @__PURE__ */ __commonJS({ "../../node_modules/math-intrin
28871
28843
  var require_sign = /* @__PURE__ */ __commonJS({ "../../node_modules/math-intrinsics/sign.js": ((exports, module) => {
28872
28844
  var $isNaN = require_isNaN();
28873
28845
  /** @type {import('./sign')} */
28874
- module.exports = function sign$3(number) {
28846
+ module.exports = function sign$2(number) {
28875
28847
  if ($isNaN(number) || number === 0) return number;
28876
28848
  return number < 0 ? -1 : 1;
28877
28849
  };
@@ -29141,7 +29113,7 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
29141
29113
  var min = require_min();
29142
29114
  var pow = require_pow();
29143
29115
  var round = require_round();
29144
- var sign$2 = require_sign();
29116
+ var sign$1 = require_sign();
29145
29117
  var $Function = Function;
29146
29118
  var getEvalledConstructor = function(expressionSyntax) {
29147
29119
  try {
@@ -29253,14 +29225,13 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
29253
29225
  "%Math.min%": min,
29254
29226
  "%Math.pow%": pow,
29255
29227
  "%Math.round%": round,
29256
- "%Math.sign%": sign$2,
29228
+ "%Math.sign%": sign$1,
29257
29229
  "%Reflect.getPrototypeOf%": $ReflectGPO
29258
29230
  };
29259
29231
  if (getProto) try {
29260
29232
  null.error;
29261
29233
  } catch (e) {
29262
- var errorProto = getProto(getProto(e));
29263
- INTRINSICS["%Error.prototype%"] = errorProto;
29234
+ INTRINSICS["%Error.prototype%"] = getProto(getProto(e));
29264
29235
  }
29265
29236
  var doEval = function doEval$1(name) {
29266
29237
  var value;
@@ -29433,7 +29404,7 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
29433
29404
  else if (value != null) {
29434
29405
  if (!(part in value)) {
29435
29406
  if (!allowMissing) throw new $TypeError$3("base intrinsic for " + name + " exists, but the property is not available.");
29436
- return void 0;
29407
+ return;
29437
29408
  }
29438
29409
  if ($gOPD && i$6 + 1 >= parts.length) {
29439
29410
  var desc$1 = $gOPD(value, part);
@@ -29537,7 +29508,7 @@ var require_side_channel_weakmap = /* @__PURE__ */ __commonJS({ "../../node_modu
29537
29508
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
29538
29509
  var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
29539
29510
  /** @type {import('.')} */
29540
- module.exports = $WeakMap ? function getSideChannelWeakMap$1() {
29511
+ module.exports = $WeakMap ? function getSideChannelWeakMap() {
29541
29512
  /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
29542
29513
  /** @typedef {Parameters<Channel['get']>[0]} K */
29543
29514
  /** @typedef {Parameters<Channel['set']>[1]} V */
@@ -29589,8 +29560,7 @@ var require_side_channel = /* @__PURE__ */ __commonJS({ "../../node_modules/side
29589
29560
  var inspect = require_object_inspect();
29590
29561
  var getSideChannelList = require_side_channel_list();
29591
29562
  var getSideChannelMap = require_side_channel_map();
29592
- var getSideChannelWeakMap = require_side_channel_weakmap();
29593
- var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
29563
+ var makeChannel = require_side_channel_weakmap() || getSideChannelMap || getSideChannelList;
29594
29564
  /** @type {import('.')} */
29595
29565
  module.exports = function getSideChannel$1() {
29596
29566
  /** @typedef {ReturnType<typeof getSideChannel>} Channel */
@@ -29885,10 +29855,7 @@ var require_stringify = /* @__PURE__ */ __commonJS({ "../../node_modules/qs/lib/
29885
29855
  obj = "";
29886
29856
  }
29887
29857
  if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
29888
- if (encoder) {
29889
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset$1, "key", format$4);
29890
- return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults$1.encoder, charset$1, "value", format$4))];
29891
- }
29858
+ if (encoder) return [formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset$1, "key", format$4)) + "=" + formatter(encoder(obj, defaults$1.encoder, charset$1, "value", format$4))];
29892
29859
  return [formatter(prefix) + "=" + formatter(String(obj))];
29893
29860
  }
29894
29861
  var values = [];
@@ -30141,9 +30108,8 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/qs/lib/pars
30141
30108
  var charset$1 = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
30142
30109
  var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
30143
30110
  if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") throw new TypeError("The duplicates option must be either combine, first, or last");
30144
- var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
30145
30111
  return {
30146
- allowDots,
30112
+ allowDots: typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots,
30147
30113
  allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
30148
30114
  allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
30149
30115
  allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
@@ -30522,7 +30488,7 @@ var require_parseurl = /* @__PURE__ */ __commonJS({ "../../node_modules/parseurl
30522
30488
  */
30523
30489
  function parseurl(req$2) {
30524
30490
  var url$2 = req$2.url;
30525
- if (url$2 === void 0) return void 0;
30491
+ if (url$2 === void 0) return;
30526
30492
  var parsed = req$2._parsedUrl;
30527
30493
  if (fresh$3(url$2, parsed)) return parsed;
30528
30494
  parsed = fastparse(url$2);
@@ -30788,8 +30754,7 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/fina
30788
30754
  * @private
30789
30755
  */
30790
30756
  function createHtmlDocument$2(message) {
30791
- var body = escapeHtml$3(message).replaceAll("\n", "<br>").replaceAll(" ", " &nbsp;");
30792
- return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>" + body + "</pre>\n</body>\n</html>\n";
30757
+ return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>" + escapeHtml$3(message).replaceAll("\n", "<br>").replaceAll(" ", " &nbsp;") + "</pre>\n</body>\n</html>\n";
30793
30758
  }
30794
30759
  /**
30795
30760
  * Module exports.
@@ -30844,7 +30809,7 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/fina
30844
30809
  * @private
30845
30810
  */
30846
30811
  function getErrorHeaders(err) {
30847
- if (!err.headers || typeof err.headers !== "object") return void 0;
30812
+ if (!err.headers || typeof err.headers !== "object") return;
30848
30813
  return { ...err.headers };
30849
30814
  }
30850
30815
  /**
@@ -30874,7 +30839,6 @@ var require_finalhandler = /* @__PURE__ */ __commonJS({ "../../node_modules/fina
30874
30839
  function getErrorStatusCode(err) {
30875
30840
  if (typeof err.status === "number" && err.status >= 400 && err.status < 600) return err.status;
30876
30841
  if (typeof err.statusCode === "number" && err.statusCode >= 400 && err.statusCode < 600) return err.statusCode;
30877
- return void 0;
30878
30842
  }
30879
30843
  /**
30880
30844
  * Get resource name for the request.
@@ -31071,7 +31035,7 @@ var require_view = /* @__PURE__ */ __commonJS({ "../../node_modules/express/lib/
31071
31035
  try {
31072
31036
  return fs$4.statSync(path$7);
31073
31037
  } catch (e) {
31074
- return void 0;
31038
+ return;
31075
31039
  }
31076
31040
  }
31077
31041
  }) });
@@ -31105,8 +31069,7 @@ var require_etag = /* @__PURE__ */ __commonJS({ "../../node_modules/etag/index.j
31105
31069
  function entitytag(entity) {
31106
31070
  if (entity.length === 0) return "\"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk\"";
31107
31071
  var hash = crypto$1.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
31108
- var len = typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length;
31109
- return "\"" + len.toString(16) + "-" + hash + "\"";
31072
+ return "\"" + (typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length).toString(16) + "-" + hash + "\"";
31110
31073
  }
31111
31074
  /**
31112
31075
  * Create a simple ETag.
@@ -31145,8 +31108,7 @@ var require_etag = /* @__PURE__ */ __commonJS({ "../../node_modules/etag/index.j
31145
31108
  */
31146
31109
  function stattag(stat) {
31147
31110
  var mtime = stat.mtime.getTime().toString(16);
31148
- var size = stat.size.toString(16);
31149
- return "\"" + size + "-" + mtime + "\"";
31111
+ return "\"" + stat.size.toString(16) + "-" + mtime + "\"";
31150
31112
  }
31151
31113
  }) });
31152
31114
 
@@ -31168,9 +31130,7 @@ var require_forwarded = /* @__PURE__ */ __commonJS({ "../../node_modules/forward
31168
31130
  function forwarded$1(req$2) {
31169
31131
  if (!req$2) throw new TypeError("argument req is required");
31170
31132
  var proxyAddrs = parse$5(req$2.headers["x-forwarded-for"] || "");
31171
- var socketAddr = getSocketAddr(req$2);
31172
- var addrs = [socketAddr].concat(proxyAddrs);
31173
- return addrs;
31133
+ return [getSocketAddr(req$2)].concat(proxyAddrs);
31174
31134
  }
31175
31135
  /**
31176
31136
  * Get the socket address for a request.
@@ -31213,9 +31173,7 @@ var require_forwarded = /* @__PURE__ */ __commonJS({ "../../node_modules/forward
31213
31173
  //#region ../../node_modules/ipaddr.js/lib/ipaddr.js
31214
31174
  var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/lib/ipaddr.js": ((exports, module) => {
31215
31175
  (function() {
31216
- var expandIPv6, ipaddr$1, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex;
31217
- ipaddr$1 = {};
31218
- root = this;
31176
+ var expandIPv6, ipaddr$1 = {}, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root = this, zoneIndex;
31219
31177
  if (typeof module !== "undefined" && module !== null && module.exports) module.exports = ipaddr$1;
31220
31178
  else root["ipaddr"] = ipaddr$1;
31221
31179
  matchCIDR = function(first$2, second, partSize, cidrBits) {
@@ -31377,8 +31335,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31377
31335
  return ipaddr$1.IPv6.parse("::ffff:" + this.toString());
31378
31336
  };
31379
31337
  IPv4.prototype.prefixLengthFromSubnetMask = function() {
31380
- var cidr, i$6, k, octet, stop, zeros, zerotable;
31381
- zerotable = {
31338
+ var cidr, i$6, k, octet, stop, zeros, zerotable = {
31382
31339
  0: 8,
31383
31340
  128: 7,
31384
31341
  192: 6,
@@ -31410,15 +31367,12 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31410
31367
  longValue: new RegExp("^" + ipv4Part + "$", "i")
31411
31368
  };
31412
31369
  ipaddr$1.IPv4.parser = function(string) {
31413
- var match$1, parseIntAuto, part, shift, value;
31414
- parseIntAuto = function(string$1) {
31370
+ var match$1, parseIntAuto = function(string$1) {
31415
31371
  if (string$1[0] === "0" && string$1[1] !== "x") return parseInt(string$1, 8);
31416
31372
  else return parseInt(string$1);
31417
- };
31373
+ }, part, shift, value;
31418
31374
  if (match$1 = string.match(ipv4Regexes.fourOctet)) return (function() {
31419
- var k, len, ref, results;
31420
- ref = match$1.slice(1, 6);
31421
- results = [];
31375
+ var k, len, ref = match$1.slice(1, 6), results = [];
31422
31376
  for (k = 0, len = ref.length; k < len; k++) {
31423
31377
  part = ref[k];
31424
31378
  results.push(parseIntAuto(part));
@@ -31429,8 +31383,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31429
31383
  value = parseIntAuto(match$1[1]);
31430
31384
  if (value > 4294967295 || value < 0) throw new Error("ipaddr: address outside defined range");
31431
31385
  return (function() {
31432
- var k, results;
31433
- results = [];
31386
+ var k, results = [];
31434
31387
  for (shift = k = 0; k <= 24; shift = k += 8) results.push(value >> shift & 255);
31435
31388
  return results;
31436
31389
  })().reverse();
@@ -31458,9 +31411,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31458
31411
  return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
31459
31412
  };
31460
31413
  IPv6.prototype.toRFC5952String = function() {
31461
- var bestMatchIndex, bestMatchLength, match$1, regex, string;
31462
- regex = /((^|:)(0(:|$)){2,})/g;
31463
- string = this.toNormalizedString();
31414
+ var bestMatchIndex, bestMatchLength, match$1, regex = /((^|:)(0(:|$)){2,})/g, string = this.toNormalizedString();
31464
31415
  bestMatchIndex = 0;
31465
31416
  bestMatchLength = -1;
31466
31417
  while (match$1 = regex.exec(string)) if (match$1[0].length > bestMatchLength) {
@@ -31471,9 +31422,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31471
31422
  return string.substring(0, bestMatchIndex) + "::" + string.substring(bestMatchIndex + bestMatchLength);
31472
31423
  };
31473
31424
  IPv6.prototype.toByteArray = function() {
31474
- var bytes$3, k, len, part, ref;
31475
- bytes$3 = [];
31476
- ref = this.parts;
31425
+ var bytes$3 = [], k, len, part, ref = this.parts;
31477
31426
  for (k = 0, len = ref.length; k < len; k++) {
31478
31427
  part = ref[k];
31479
31428
  bytes$3.push(part >> 8);
@@ -31482,34 +31431,26 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31482
31431
  return bytes$3;
31483
31432
  };
31484
31433
  IPv6.prototype.toNormalizedString = function() {
31485
- var addr, part, suffix;
31486
- addr = (function() {
31487
- var k, len, ref, results;
31488
- ref = this.parts;
31489
- results = [];
31434
+ var addr = (function() {
31435
+ var k, len, ref = this.parts, results = [];
31490
31436
  for (k = 0, len = ref.length; k < len; k++) {
31491
31437
  part = ref[k];
31492
31438
  results.push(part.toString(16));
31493
31439
  }
31494
31440
  return results;
31495
- }).call(this).join(":");
31496
- suffix = "";
31441
+ }).call(this).join(":"), part, suffix = "";
31497
31442
  if (this.zoneId) suffix = "%" + this.zoneId;
31498
31443
  return addr + suffix;
31499
31444
  };
31500
31445
  IPv6.prototype.toFixedLengthString = function() {
31501
- var addr, part, suffix;
31502
- addr = (function() {
31503
- var k, len, ref, results;
31504
- ref = this.parts;
31505
- results = [];
31446
+ var addr = (function() {
31447
+ var k, len, ref = this.parts, results = [];
31506
31448
  for (k = 0, len = ref.length; k < len; k++) {
31507
31449
  part = ref[k];
31508
31450
  results.push(part.toString(16).padStart(4, "0"));
31509
31451
  }
31510
31452
  return results;
31511
- }).call(this).join(":");
31512
- suffix = "";
31453
+ }).call(this).join(":"), part, suffix = "";
31513
31454
  if (this.zoneId) suffix = "%" + this.zoneId;
31514
31455
  return addr + suffix;
31515
31456
  };
@@ -31649,8 +31590,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31649
31590
  ]);
31650
31591
  };
31651
31592
  IPv6.prototype.prefixLengthFromSubnetMask = function() {
31652
- var cidr, i$6, k, part, stop, zeros, zerotable;
31653
- zerotable = {
31593
+ var cidr, i$6, k, part, stop, zeros, zerotable = {
31654
31594
  0: 16,
31655
31595
  32768: 15,
31656
31596
  49152: 14,
@@ -31712,9 +31652,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31712
31652
  if (string[0] === ":") string = string.slice(1);
31713
31653
  if (string[string.length - 1] === ":") string = string.slice(0, -1);
31714
31654
  parts = (function() {
31715
- var k, len, ref, results;
31716
- ref = string.split(":");
31717
- results = [];
31655
+ var k, len, ref = string.split(":"), results = [];
31718
31656
  for (k = 0, len = ref.length; k < len; k++) {
31719
31657
  part = ref[k];
31720
31658
  results.push(parseInt(part, 16));
@@ -31757,12 +31695,10 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31757
31695
  return this.parser(string) !== null;
31758
31696
  };
31759
31697
  ipaddr$1.IPv4.isValid = function(string) {
31760
- var e;
31761
31698
  try {
31762
31699
  new this(this.parser(string));
31763
31700
  return true;
31764
31701
  } catch (error1) {
31765
- e = error1;
31766
31702
  return false;
31767
31703
  }
31768
31704
  };
@@ -31771,26 +31707,23 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31771
31707
  else return false;
31772
31708
  };
31773
31709
  ipaddr$1.IPv6.isValid = function(string) {
31774
- var addr, e;
31710
+ var addr;
31775
31711
  if (typeof string === "string" && string.indexOf(":") === -1) return false;
31776
31712
  try {
31777
31713
  addr = this.parser(string);
31778
31714
  new this(addr.parts, addr.zoneId);
31779
31715
  return true;
31780
31716
  } catch (error1) {
31781
- e = error1;
31782
31717
  return false;
31783
31718
  }
31784
31719
  };
31785
31720
  ipaddr$1.IPv4.parse = function(string) {
31786
- var parts;
31787
- parts = this.parser(string);
31721
+ var parts = this.parser(string);
31788
31722
  if (parts === null) throw new Error("ipaddr: string is not formatted like ip address");
31789
31723
  return new this(parts);
31790
31724
  };
31791
31725
  ipaddr$1.IPv6.parse = function(string) {
31792
- var addr;
31793
- addr = this.parser(string);
31726
+ var addr = this.parser(string);
31794
31727
  if (addr.parts === null) throw new Error("ipaddr: string is not formatted like ip address");
31795
31728
  return new this(addr.parts, addr.zoneId);
31796
31729
  };
@@ -31828,7 +31761,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31828
31761
  return new this(octets);
31829
31762
  };
31830
31763
  ipaddr$1.IPv4.broadcastAddressFromCIDR = function(string) {
31831
- var cidr, error, i$6, ipInterfaceOctets, octets, subnetMaskOctets;
31764
+ var cidr, i$6, ipInterfaceOctets, octets, subnetMaskOctets;
31832
31765
  try {
31833
31766
  cidr = this.parseCIDR(string);
31834
31767
  ipInterfaceOctets = cidr[0].toByteArray();
@@ -31841,12 +31774,11 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31841
31774
  }
31842
31775
  return new this(octets);
31843
31776
  } catch (error1) {
31844
- error = error1;
31845
31777
  throw new Error("ipaddr: the address does not have IPv4 CIDR format");
31846
31778
  }
31847
31779
  };
31848
31780
  ipaddr$1.IPv4.networkAddressFromCIDR = function(string) {
31849
- var cidr, error, i$6, ipInterfaceOctets, octets, subnetMaskOctets;
31781
+ var cidr, i$6, ipInterfaceOctets, octets, subnetMaskOctets;
31850
31782
  try {
31851
31783
  cidr = this.parseCIDR(string);
31852
31784
  ipInterfaceOctets = cidr[0].toByteArray();
@@ -31859,7 +31791,6 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31859
31791
  }
31860
31792
  return new this(octets);
31861
31793
  } catch (error1) {
31862
- error = error1;
31863
31794
  throw new Error("ipaddr: the address does not have IPv4 CIDR format");
31864
31795
  }
31865
31796
  };
@@ -31886,29 +31817,24 @@ var require_ipaddr = /* @__PURE__ */ __commonJS({ "../../node_modules/ipaddr.js/
31886
31817
  else throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
31887
31818
  };
31888
31819
  ipaddr$1.parseCIDR = function(string) {
31889
- var e;
31890
31820
  try {
31891
31821
  return ipaddr$1.IPv6.parseCIDR(string);
31892
31822
  } catch (error1) {
31893
- e = error1;
31894
31823
  try {
31895
31824
  return ipaddr$1.IPv4.parseCIDR(string);
31896
31825
  } catch (error1$1) {
31897
- e = error1$1;
31898
31826
  throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
31899
31827
  }
31900
31828
  }
31901
31829
  };
31902
31830
  ipaddr$1.fromByteArray = function(bytes$3) {
31903
- var length;
31904
- length = bytes$3.length;
31831
+ var length = bytes$3.length;
31905
31832
  if (length === 4) return new ipaddr$1.IPv4(bytes$3);
31906
31833
  else if (length === 16) return new ipaddr$1.IPv6(bytes$3);
31907
31834
  else throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
31908
31835
  };
31909
31836
  ipaddr$1.process = function(string) {
31910
- var addr;
31911
- addr = this.parse(string);
31837
+ var addr = this.parse(string);
31912
31838
  if (addr.kind() === "ipv6" && addr.isIPv4MappedAddress()) return addr.toIPv4Address();
31913
31839
  else return addr;
31914
31840
  };
@@ -32041,8 +31967,7 @@ var require_proxy_addr = /* @__PURE__ */ __commonJS({ "../../node_modules/proxy-
32041
31967
  */
32042
31968
  function parseNetmask(netmask) {
32043
31969
  var ip = parseip(netmask);
32044
- var kind = ip.kind();
32045
- return kind === "ipv4" ? ip.prefixLengthFromSubnetMask() : null;
31970
+ return ip.kind() === "ipv4" ? ip.prefixLengthFromSubnetMask() : null;
32046
31971
  }
32047
31972
  /**
32048
31973
  * Determine address of proxied request.
@@ -32055,8 +31980,7 @@ var require_proxy_addr = /* @__PURE__ */ __commonJS({ "../../node_modules/proxy-
32055
31980
  if (!req$2) throw new TypeError("req argument is required");
32056
31981
  if (!trust) throw new TypeError("trust argument is required");
32057
31982
  var addrs = alladdrs(req$2, trust);
32058
- var addr = addrs[addrs.length - 1];
32059
- return addr;
31983
+ return addrs[addrs.length - 1];
32060
31984
  }
32061
31985
  /**
32062
31986
  * Static trust function to trust nothing.
@@ -32108,8 +32032,7 @@ var require_proxy_addr = /* @__PURE__ */ __commonJS({ "../../node_modules/proxy-
32108
32032
  return function trust(addr) {
32109
32033
  if (!isip(addr)) return false;
32110
32034
  var ip = parseip(addr);
32111
- var kind = ip.kind();
32112
- if (kind !== subnetkind) {
32035
+ if (ip.kind() !== subnetkind) {
32113
32036
  if (subnetisipv4 && !ip.isIPv4MappedAddress()) return false;
32114
32037
  ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress();
32115
32038
  }
@@ -32302,8 +32225,7 @@ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/express/lib
32302
32225
  */
32303
32226
  function createETagGenerator(options) {
32304
32227
  return function generateETag(body, encoding) {
32305
- var buf = !Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body;
32306
- return etag$1(buf, options);
32228
+ return etag$1(!Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body, options);
32307
32229
  };
32308
32230
  }
32309
32231
  /**
@@ -32377,8 +32299,7 @@ var require_once = /* @__PURE__ */ __commonJS({ "../../node_modules/once/once.js
32377
32299
  f.called = true;
32378
32300
  return f.value = fn.apply(this, arguments);
32379
32301
  };
32380
- var name = fn.name || "Function wrapped with `once`";
32381
- f.onceError = name + " shouldn't be called more than once";
32302
+ f.onceError = (fn.name || "Function wrapped with `once`") + " shouldn't be called more than once";
32382
32303
  f.called = false;
32383
32304
  return f;
32384
32305
  }
@@ -32398,7 +32319,6 @@ var require_is_promise = /* @__PURE__ */ __commonJS({ "../../node_modules/is-pro
32398
32319
  //#region ../../node_modules/path-to-regexp/dist/index.js
32399
32320
  var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-regexp/dist/index.js": ((exports) => {
32400
32321
  Object.defineProperty(exports, "__esModule", { value: true });
32401
- exports.PathError = exports.TokenData = void 0;
32402
32322
  exports.parse = parse$4;
32403
32323
  exports.compile = compile;
32404
32324
  exports.match = match;
@@ -32561,8 +32481,7 @@ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-rege
32561
32481
  */
32562
32482
  function compile(path$7, options = {}) {
32563
32483
  const { encode: encode$5 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
32564
- const data = typeof path$7 === "object" ? path$7 : parse$4(path$7, options);
32565
- const fn = tokensToFunction(data.tokens, delimiter, encode$5);
32484
+ const fn = tokensToFunction((typeof path$7 === "object" ? path$7 : parse$4(path$7, options)).tokens, delimiter, encode$5);
32566
32485
  return function path$8(params = {}) {
32567
32486
  const [path$9, ...missing] = fn(params);
32568
32487
  if (missing.length) throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
@@ -32651,9 +32570,8 @@ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-rege
32651
32570
  let pattern = `^(?:${sources.join("|")})`;
32652
32571
  if (trailing) pattern += `(?:${escape$1(delimiter)}$)?`;
32653
32572
  pattern += end ? "$" : `(?=${escape$1(delimiter)}|$)`;
32654
- const regexp = new RegExp(pattern, flags);
32655
32573
  return {
32656
- regexp,
32574
+ regexp: new RegExp(pattern, flags),
32657
32575
  keys
32658
32576
  };
32659
32577
  }
@@ -32719,8 +32637,7 @@ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-rege
32719
32637
  let value = "";
32720
32638
  let i$6 = 0;
32721
32639
  function name(value$1) {
32722
- const isSafe = isNameSafe(value$1) && isNextNameSafe(tokens[i$6]);
32723
- return isSafe ? value$1 : JSON.stringify(value$1);
32640
+ return isNameSafe(value$1) && isNextNameSafe(tokens[i$6]) ? value$1 : JSON.stringify(value$1);
32724
32641
  }
32725
32642
  while (i$6 < tokens.length) {
32726
32643
  const token = tokens[i$6++];
@@ -32811,8 +32728,7 @@ var require_layer = /* @__PURE__ */ __commonJS({ "../../node_modules/router/lib/
32811
32728
  if (!match$1) return false;
32812
32729
  const params = {};
32813
32730
  for (let i$6 = 1; i$6 < match$1.length; i$6++) {
32814
- const key$1 = keys[i$6 - 1];
32815
- const prop = key$1.name;
32731
+ const prop = keys[i$6 - 1].name;
32816
32732
  const val = decodeParam(match$1[i$6]);
32817
32733
  if (val !== void 0) params[prop] = val;
32818
32734
  }
@@ -33105,7 +33021,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33105
33021
  /**
33106
33022
  * Expose `Router`.
33107
33023
  */
33108
- module.exports = Router$2;
33024
+ module.exports = Router$3;
33109
33025
  /**
33110
33026
  * Expose `Route`.
33111
33027
  */
@@ -33117,8 +33033,8 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33117
33033
  * @return {Router} which is a callable function
33118
33034
  * @public
33119
33035
  */
33120
- function Router$2(options) {
33121
- if (!(this instanceof Router$2)) return new Router$2(options);
33036
+ function Router$3(options) {
33037
+ if (!(this instanceof Router$3)) return new Router$3(options);
33122
33038
  const opts = options || {};
33123
33039
  function router(req$2, res$2, next) {
33124
33040
  router.handle(req$2, res$2, next);
@@ -33135,7 +33051,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33135
33051
  * Router prototype inherits from a Function.
33136
33052
  */
33137
33053
  /* istanbul ignore next */
33138
- Router$2.prototype = function() {};
33054
+ Router$3.prototype = function() {};
33139
33055
  /**
33140
33056
  * Map the given param placeholder `name`(s) to the given callback.
33141
33057
  *
@@ -33168,7 +33084,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33168
33084
  * @param {function} fn
33169
33085
  * @public
33170
33086
  */
33171
- Router$2.prototype.param = function param(name, fn) {
33087
+ Router$3.prototype.param = function param(name, fn) {
33172
33088
  if (!name) throw new TypeError("argument name is required");
33173
33089
  if (typeof name !== "string") throw new TypeError("argument name must be a string");
33174
33090
  if (!fn) throw new TypeError("argument fn is required");
@@ -33183,7 +33099,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33183
33099
  *
33184
33100
  * @private
33185
33101
  */
33186
- Router$2.prototype.handle = function handle(req$2, res$2, callback) {
33102
+ Router$3.prototype.handle = function handle(req$2, res$2, callback) {
33187
33103
  if (!callback) throw new TypeError("argument callback is required");
33188
33104
  debug$2("dispatching %s %s", req$2.method, req$2.url);
33189
33105
  let idx = 0;
@@ -33297,7 +33213,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33297
33213
  *
33298
33214
  * @public
33299
33215
  */
33300
- Router$2.prototype.use = function use(handler) {
33216
+ Router$3.prototype.use = function use(handler) {
33301
33217
  let offset = 0;
33302
33218
  let path$7 = "/";
33303
33219
  if (typeof handler !== "function") {
@@ -33336,7 +33252,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33336
33252
  * @return {Route}
33337
33253
  * @public
33338
33254
  */
33339
- Router$2.prototype.route = function route(path$7) {
33255
+ Router$3.prototype.route = function route(path$7) {
33340
33256
  const route$1 = new Route(path$7);
33341
33257
  const layer = new Layer(path$7, {
33342
33258
  sensitive: this.caseSensitive,
@@ -33351,7 +33267,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33351
33267
  return route$1;
33352
33268
  };
33353
33269
  methods$1.concat("all").forEach(function(method) {
33354
- Router$2.prototype[method] = function(path$7) {
33270
+ Router$3.prototype[method] = function(path$7) {
33355
33271
  const route = this.route(path$7);
33356
33272
  route[method].apply(route, slice$1.call(arguments, 1));
33357
33273
  return this;
@@ -33380,7 +33296,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33380
33296
  try {
33381
33297
  return parseUrl$1(req$2).pathname;
33382
33298
  } catch (err) {
33383
- return void 0;
33299
+ return;
33384
33300
  }
33385
33301
  }
33386
33302
  /**
@@ -33390,7 +33306,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33390
33306
  * @private
33391
33307
  */
33392
33308
  function getProtohost(url$2) {
33393
- if (typeof url$2 !== "string" || url$2.length === 0 || url$2[0] === "/") return void 0;
33309
+ if (typeof url$2 !== "string" || url$2.length === 0 || url$2[0] === "/") return;
33394
33310
  const searchIndex = url$2.indexOf("?");
33395
33311
  const pathLength = searchIndex !== -1 ? searchIndex : url$2.length;
33396
33312
  const fqdnIndex = url$2.substring(0, pathLength).indexOf("://");
@@ -33562,7 +33478,7 @@ var require_application = /* @__PURE__ */ __commonJS({ "../../node_modules/expre
33562
33478
  var compileTrust = require_utils().compileTrust;
33563
33479
  var resolve$3 = require("node:path").resolve;
33564
33480
  var once = require_once();
33565
- var Router$1 = require_router();
33481
+ var Router$2 = require_router();
33566
33482
  /**
33567
33483
  * Module variables.
33568
33484
  * @private
@@ -33597,7 +33513,7 @@ var require_application = /* @__PURE__ */ __commonJS({ "../../node_modules/expre
33597
33513
  configurable: true,
33598
33514
  enumerable: true,
33599
33515
  get: function getrouter() {
33600
- if (router === null) router = new Router$1({
33516
+ if (router === null) router = new Router$2({
33601
33517
  caseSensitive: this.enabled("case sensitive routing"),
33602
33518
  strict: this.enabled("strict routing")
33603
33519
  });
@@ -33936,8 +33852,7 @@ var require_application = /* @__PURE__ */ __commonJS({ "../../node_modules/expre
33936
33852
  if (renderOptions.cache == null) renderOptions.cache = this.enabled("view cache");
33937
33853
  if (renderOptions.cache) view = cache[name];
33938
33854
  if (!view) {
33939
- var View$2 = this.get("view");
33940
- view = new View$2(name, {
33855
+ view = new (this.get("view"))(name, {
33941
33856
  defaultEngine: this.get("view engine"),
33942
33857
  root: this.get("views"),
33943
33858
  engines
@@ -34714,8 +34629,7 @@ var require_accepts = /* @__PURE__ */ __commonJS({ "../../node_modules/accepts/i
34714
34629
  if (!types || types.length === 0) return this.negotiator.mediaTypes();
34715
34630
  if (!this.headers.accept) return types[0];
34716
34631
  var mimes = types.map(extToMime);
34717
- var accepts$1 = this.negotiator.mediaTypes(mimes.filter(validMime));
34718
- var first$2 = accepts$1[0];
34632
+ var first$2 = this.negotiator.mediaTypes(mimes.filter(validMime))[0];
34719
34633
  return first$2 ? types[mimes.indexOf(first$2)] : false;
34720
34634
  };
34721
34635
  /**
@@ -34843,8 +34757,7 @@ var require_fresh = /* @__PURE__ */ __commonJS({ "../../node_modules/fresh/index
34843
34757
  }
34844
34758
  if (modifiedSince) {
34845
34759
  var lastModified = resHeaders["last-modified"];
34846
- var modifiedStale = !lastModified || !(parseHttpDate$1(lastModified) <= parseHttpDate$1(modifiedSince));
34847
- if (modifiedStale) return false;
34760
+ if (!lastModified || !(parseHttpDate$1(lastModified) <= parseHttpDate$1(modifiedSince))) return false;
34848
34761
  }
34849
34762
  return true;
34850
34763
  }
@@ -35219,8 +35132,7 @@ var require_request = /* @__PURE__ */ __commonJS({ "../../node_modules/express/l
35219
35132
  */
35220
35133
  defineGetter(req$1, "protocol", function protocol() {
35221
35134
  var proto$1 = this.connection.encrypted ? "https" : "http";
35222
- var trust = this.app.get("trust proxy fn");
35223
- if (!trust(this.connection.remoteAddress, 0)) return proto$1;
35135
+ if (!this.app.get("trust proxy fn")(this.connection.remoteAddress, 0)) return proto$1;
35224
35136
  var header = this.get("X-Forwarded-Proto") || proto$1;
35225
35137
  var index = header.indexOf(",");
35226
35138
  return index !== -1 ? header.substring(0, index).trim() : header.trim();
@@ -35284,8 +35196,7 @@ var require_request = /* @__PURE__ */ __commonJS({ "../../node_modules/express/l
35284
35196
  var hostname = this.hostname;
35285
35197
  if (!hostname) return [];
35286
35198
  var offset = this.app.get("subdomain offset");
35287
- var subdomains$1 = !isIP(hostname) ? hostname.split(".").reverse() : [hostname];
35288
- return subdomains$1.slice(offset);
35199
+ return (!isIP(hostname) ? hostname.split(".").reverse() : [hostname]).slice(offset);
35289
35200
  });
35290
35201
  /**
35291
35202
  * Short-hand for `url.parse(req.url).pathname`.
@@ -35367,8 +35278,7 @@ var require_request = /* @__PURE__ */ __commonJS({ "../../node_modules/express/l
35367
35278
  * @public
35368
35279
  */
35369
35280
  defineGetter(req$1, "xhr", function xhr() {
35370
- var val = this.get("X-Requested-With") || "";
35371
- return val.toLowerCase() === "xmlhttprequest";
35281
+ return (this.get("X-Requested-With") || "").toLowerCase() === "xmlhttprequest";
35372
35282
  });
35373
35283
  /**
35374
35284
  * Helper function for creating a getter on an object.
@@ -35547,9 +35457,7 @@ var require_content_disposition = /* @__PURE__ */ __commonJS({ "../../node_modul
35547
35457
  */
35548
35458
  function contentDisposition$1(filename, options) {
35549
35459
  var opts = options || {};
35550
- var type = opts.type || "attachment";
35551
- var params = createparams(filename, opts.fallback);
35552
- return format(new ContentDisposition(type, params));
35460
+ return format(new ContentDisposition(opts.type || "attachment", createparams(filename, opts.fallback)));
35553
35461
  }
35554
35462
  /**
35555
35463
  * Create parameters object from filename and fallback.
@@ -35702,8 +35610,7 @@ var require_content_disposition = /* @__PURE__ */ __commonJS({ "../../node_modul
35702
35610
  * @private
35703
35611
  */
35704
35612
  function qstring(val) {
35705
- var str = String(val);
35706
- return "\"" + str.replace(QUOTE_REGEXP, "\\$1") + "\"";
35613
+ return "\"" + String(val).replace(QUOTE_REGEXP, "\\$1") + "\"";
35707
35614
  }
35708
35615
  /**
35709
35616
  * Encode a Unicode string for HTTP (RFC 5987).
@@ -35714,8 +35621,7 @@ var require_content_disposition = /* @__PURE__ */ __commonJS({ "../../node_modul
35714
35621
  */
35715
35622
  function ustring(val) {
35716
35623
  var str = String(val);
35717
- var encoded = encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode);
35718
- return "UTF-8''" + encoded;
35624
+ return "UTF-8''" + encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode);
35719
35625
  }
35720
35626
  /**
35721
35627
  * Class for parsed Content-Disposition header for v8 optimization
@@ -35876,8 +35782,7 @@ var require_cookie = /* @__PURE__ */ __commonJS({ "../../node_modules/cookie/ind
35876
35782
  valStartIdx++;
35877
35783
  valEndIdx--;
35878
35784
  }
35879
- var val = str.slice(valStartIdx, valEndIdx);
35880
- obj[key$1] = tryDecode(val, dec);
35785
+ obj[key$1] = tryDecode(str.slice(valStartIdx, valEndIdx), dec);
35881
35786
  }
35882
35787
  index = endIdx + 1;
35883
35788
  } while (index < len);
@@ -35941,38 +35846,32 @@ var require_cookie = /* @__PURE__ */ __commonJS({ "../../node_modules/cookie/ind
35941
35846
  if (opt.httpOnly) str += "; HttpOnly";
35942
35847
  if (opt.secure) str += "; Secure";
35943
35848
  if (opt.partitioned) str += "; Partitioned";
35944
- if (opt.priority) {
35945
- var priority = typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority;
35946
- switch (priority) {
35947
- case "low":
35948
- str += "; Priority=Low";
35949
- break;
35950
- case "medium":
35951
- str += "; Priority=Medium";
35952
- break;
35953
- case "high":
35954
- str += "; Priority=High";
35955
- break;
35956
- default: throw new TypeError("option priority is invalid");
35957
- }
35849
+ if (opt.priority) switch (typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority) {
35850
+ case "low":
35851
+ str += "; Priority=Low";
35852
+ break;
35853
+ case "medium":
35854
+ str += "; Priority=Medium";
35855
+ break;
35856
+ case "high":
35857
+ str += "; Priority=High";
35858
+ break;
35859
+ default: throw new TypeError("option priority is invalid");
35958
35860
  }
35959
- if (opt.sameSite) {
35960
- var sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite;
35961
- switch (sameSite) {
35962
- case true:
35963
- str += "; SameSite=Strict";
35964
- break;
35965
- case "lax":
35966
- str += "; SameSite=Lax";
35967
- break;
35968
- case "strict":
35969
- str += "; SameSite=Strict";
35970
- break;
35971
- case "none":
35972
- str += "; SameSite=None";
35973
- break;
35974
- default: throw new TypeError("option sameSite is invalid");
35975
- }
35861
+ if (opt.sameSite) switch (typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite) {
35862
+ case true:
35863
+ str += "; SameSite=Strict";
35864
+ break;
35865
+ case "lax":
35866
+ str += "; SameSite=Lax";
35867
+ break;
35868
+ case "strict":
35869
+ str += "; SameSite=Strict";
35870
+ break;
35871
+ case "none":
35872
+ str += "; SameSite=None";
35873
+ break;
35874
+ default: throw new TypeError("option sameSite is invalid");
35976
35875
  }
35977
35876
  return str;
35978
35877
  }
@@ -36115,8 +36014,7 @@ var require_send = /* @__PURE__ */ __commonJS({ "../../node_modules/send/index.j
36115
36014
  SendStream.prototype.error = function error(status$2, err) {
36116
36015
  if (hasListeners(this, "error")) return this.emit("error", createHttpError(status$2, err));
36117
36016
  var res$2 = this.res;
36118
- var msg = statuses$1.message[status$2] || String(status$2);
36119
- var doc = createHtmlDocument$1("Error", escapeHtml$2(msg));
36017
+ var doc = createHtmlDocument$1("Error", escapeHtml$2(statuses$1.message[status$2] || String(status$2)));
36120
36018
  clearHeaders(res$2);
36121
36019
  if (err && err.headers) setHeaders(res$2, err.headers);
36122
36020
  res$2.statusCode = status$2;
@@ -36256,8 +36154,7 @@ var require_send = /* @__PURE__ */ __commonJS({ "../../node_modules/send/index.j
36256
36154
  var etag$3 = this.res.getHeader("ETag");
36257
36155
  return Boolean(etag$3 && ifRange.indexOf(etag$3) !== -1);
36258
36156
  }
36259
- var lastModified = this.res.getHeader("Last-Modified");
36260
- return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
36157
+ return parseHttpDate(this.res.getHeader("Last-Modified")) <= parseHttpDate(ifRange);
36261
36158
  };
36262
36159
  /**
36263
36160
  * Redirect to path.
@@ -36626,8 +36523,7 @@ var require_send = /* @__PURE__ */ __commonJS({ "../../node_modules/send/index.j
36626
36523
  * @private
36627
36524
  */
36628
36525
  function hasListeners(emitter, type) {
36629
- var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type);
36630
- return count > 0;
36526
+ return (typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type)) > 0;
36631
36527
  }
36632
36528
  /**
36633
36529
  * Normalize the index option into an array.
@@ -36773,8 +36669,7 @@ var require_vary = /* @__PURE__ */ __commonJS({ "../../node_modules/vary/index.j
36773
36669
  function vary$1(res$2, field) {
36774
36670
  if (!res$2 || !res$2.getHeader || !res$2.setHeader) throw new TypeError("res argument is required");
36775
36671
  var val = res$2.getHeader("Vary") || "";
36776
- var header = Array.isArray(val) ? val.join(", ") : String(val);
36777
- if (val = append(header, field)) res$2.setHeader("Vary", val);
36672
+ if (val = append(Array.isArray(val) ? val.join(", ") : String(val), field)) res$2.setHeader("Vary", val);
36778
36673
  }
36779
36674
  }) });
36780
36675
 
@@ -36795,7 +36690,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36795
36690
  var path$4 = require("node:path");
36796
36691
  var pathIsAbsolute = require("node:path").isAbsolute;
36797
36692
  var statuses = require_statuses();
36798
- var sign$1 = require_cookie_signature().sign;
36693
+ var sign = require_cookie_signature().sign;
36799
36694
  var normalizeType = require_utils().normalizeType;
36800
36695
  var normalizeTypes = require_utils().normalizeTypes;
36801
36696
  var setCharset = require_utils().setCharset;
@@ -36943,9 +36838,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36943
36838
  res$1.json = function json$1(obj) {
36944
36839
  var app$1 = this.app;
36945
36840
  var escape$2 = app$1.get("json escape");
36946
- var replacer = app$1.get("json replacer");
36947
- var spaces = app$1.get("json spaces");
36948
- var body = stringify$2(obj, replacer, spaces, escape$2);
36841
+ var body = stringify$2(obj, app$1.get("json replacer"), app$1.get("json spaces"), escape$2);
36949
36842
  if (!this.get("Content-Type")) this.set("Content-Type", "application/json");
36950
36843
  return this.send(body);
36951
36844
  };
@@ -36963,9 +36856,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36963
36856
  res$1.jsonp = function jsonp(obj) {
36964
36857
  var app$1 = this.app;
36965
36858
  var escape$2 = app$1.get("json escape");
36966
- var replacer = app$1.get("json replacer");
36967
- var spaces = app$1.get("json spaces");
36968
- var body = stringify$2(obj, replacer, spaces, escape$2);
36859
+ var body = stringify$2(obj, app$1.get("json replacer"), app$1.get("json spaces"), escape$2);
36969
36860
  var callback = this.req.query[app$1.get("jsonp callback name")];
36970
36861
  if (!this.get("Content-Type")) {
36971
36862
  this.set("X-Content-Type-Options", "nosniff");
@@ -37057,8 +36948,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
37057
36948
  if (!opts.root && !pathIsAbsolute(path$7)) throw new TypeError("path must be absolute or specify root to res.sendFile");
37058
36949
  var pathname = encodeURI(path$7);
37059
36950
  opts.etag = this.app.enabled("etag");
37060
- var file = send$1(req$2, pathname, opts);
37061
- sendfile(res$2, file, opts, function(err) {
36951
+ sendfile(res$2, send$1(req$2, pathname, opts), opts, function(err) {
37062
36952
  if (done) return done(err);
37063
36953
  if (err && err.code === "EISDIR") return next();
37064
36954
  if (err && err.code !== "ECONNABORTED" && err.syscall !== "write") next(err);
@@ -37324,7 +37214,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
37324
37214
  var signed = opts.signed;
37325
37215
  if (signed && !secret) throw new Error("cookieParser(\"secret\") required for signed cookies");
37326
37216
  var val = typeof value === "object" ? "j:" + JSON.stringify(value) : String(value);
37327
- if (signed) val = "s:" + sign$1(val, secret);
37217
+ if (signed) val = "s:" + sign(val, secret);
37328
37218
  if (opts.maxAge != null) {
37329
37219
  var maxAge = opts.maxAge - 0;
37330
37220
  if (!isNaN(maxAge)) {
@@ -37650,7 +37540,7 @@ var require_express$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/express
37650
37540
  var EventEmitter = require("node:events").EventEmitter;
37651
37541
  var mixin = require_merge_descriptors();
37652
37542
  var proto = require_application();
37653
- var Router = require_router();
37543
+ var Router$1 = require_router();
37654
37544
  var req = require_request();
37655
37545
  var res = require_response();
37656
37546
  /**
@@ -37693,8 +37583,8 @@ var require_express$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/express
37693
37583
  /**
37694
37584
  * Expose constructors.
37695
37585
  */
37696
- exports.Route = Router.Route;
37697
- exports.Router = Router;
37586
+ exports.Route = Router$1.Route;
37587
+ exports.Router = Router$1;
37698
37588
  /**
37699
37589
  * Expose middleware
37700
37590
  */
@@ -37729,10 +37619,9 @@ var require_object_assign = /* @__PURE__ */ __commonJS({ "../../node_modules/obj
37729
37619
  if (Object.getOwnPropertyNames(test1)[0] === "5") return false;
37730
37620
  var test2 = {};
37731
37621
  for (var i$6 = 0; i$6 < 10; i$6++) test2["_" + String.fromCharCode(i$6)] = i$6;
37732
- var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
37622
+ if (Object.getOwnPropertyNames(test2).map(function(n) {
37733
37623
  return test2[n];
37734
- });
37735
- if (order2.join("") !== "0123456789") return false;
37624
+ }).join("") !== "0123456789") return false;
37736
37625
  var test3 = {};
37737
37626
  "abcdefghijklmnopqrst".split("").forEach(function(letter) {
37738
37627
  test3[letter] = letter;
@@ -37870,8 +37759,8 @@ var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/cors/lib/inde
37870
37759
  }
37871
37760
  }
37872
37761
  function cors$1(options, req$2, res$2, next) {
37873
- var headers = [], method = req$2.method && req$2.method.toUpperCase && req$2.method.toUpperCase();
37874
- if (method === "OPTIONS") {
37762
+ var headers = [];
37763
+ if ((req$2.method && req$2.method.toUpperCase && req$2.method.toUpperCase()) === "OPTIONS") {
37875
37764
  headers.push(configureOrigin(options, req$2));
37876
37765
  headers.push(configureCredentials(options, req$2));
37877
37766
  headers.push(configureMethods(options, req$2));
@@ -37963,8 +37852,7 @@ const createSession = () => {
37963
37852
  //#region src/middleware/error-handling.ts
37964
37853
  function defaultErrorHandler(error, _req, res$2, next) {
37965
37854
  if (res$2.headersSent) return next(error);
37966
- let assertCondition = "Assert condition failed: ";
37967
- if (error?.message?.startsWith(assertCondition)) {
37855
+ if (error?.message?.startsWith("Assert condition failed: ")) {
37968
37856
  let errorCode = 500;
37969
37857
  let errorResponse = error.message;
37970
37858
  if (error.message.includes("::")) {
@@ -38084,8 +37972,7 @@ const createWebMessageHandler = () => function(req$2, res$2) {
38084
37972
  //#endregion
38085
37973
  //#region src/handlers/utils.ts
38086
37974
  const createPersonQuery = (store) => (predicate) => {
38087
- const users = store.schema.users.selectTableAsList(store.store.getState());
38088
- return users.find(predicate);
37975
+ return store.schema.users.selectTableAsList(store.store.getState()).find(predicate);
38089
37976
  };
38090
37977
  const deriveScope = ({ scopeConfig, clientID, audience }) => {
38091
37978
  if (typeof scopeConfig === "string") return scopeConfig;
@@ -38269,7 +38156,7 @@ function createJsonWebToken(payload, privateKey = parseKey(PRIVATE_KEY), options
38269
38156
  algorithm: "RS256",
38270
38157
  keyid: JWKS.keys[0].kid
38271
38158
  }) {
38272
- return (0, jsonwebtoken.sign)(payload, privateKey, options);
38159
+ return jsonwebtoken.sign(payload, privateKey, options);
38273
38160
  }
38274
38161
 
38275
38162
  //#endregion
@@ -38279,17 +38166,15 @@ const extensionlessFileName = (fileName) => fileName.indexOf(".") === -1 ? fileN
38279
38166
  //#endregion
38280
38167
  //#region src/rules/parse-rules-files.ts
38281
38168
  function parseRulesFiles(rulesPath) {
38282
- let ruleFiles = fs.default.readdirSync(rulesPath).filter((f) => path.default.extname(f) === ".js");
38283
- return ruleFiles.map((r) => {
38169
+ return fs.default.readdirSync(rulesPath).filter((f) => path.default.extname(f) === ".js").map((r) => {
38284
38170
  let filename = path.default.join(rulesPath, r);
38285
38171
  let jsonFile = `${extensionlessFileName(filename)}.json`;
38286
38172
  (0, assert_ts.assert)(!!jsonFile, `no corresponding rule file for ${r}`);
38287
38173
  let rawRule = fs.default.readFileSync(jsonFile, "utf8");
38288
38174
  let { enabled, order = 0, stage = "login_success" } = JSON.parse(rawRule);
38289
- if (!enabled) return void 0;
38290
- let code = fs.default.readFileSync(filename, { encoding: "utf-8" });
38175
+ if (!enabled) return;
38291
38176
  return {
38292
- code,
38177
+ code: fs.default.readFileSync(filename, { encoding: "utf-8" }),
38293
38178
  filename,
38294
38179
  order,
38295
38180
  stage
@@ -38324,7 +38209,7 @@ async function runRule(user, context, rule) {
38324
38209
  (0, assert_ts.assert)(typeof rule !== "undefined", "undefined rule");
38325
38210
  let { code, filename } = rule;
38326
38211
  console.debug(`executing rule ${path.default.basename(filename)}`);
38327
- let script = new vm.default.Script(`
38212
+ new vm.default.Script(`
38328
38213
  (async function(exports) {
38329
38214
  try {
38330
38215
  await (${code})(__simulator.user, __simulator.context, resolve);
@@ -38333,8 +38218,7 @@ async function runRule(user, context, rule) {
38333
38218
  reject();
38334
38219
  }
38335
38220
  })(module.exports)
38336
- `);
38337
- script.runInContext(vmContext, {
38221
+ `).runInContext(vmContext, {
38338
38222
  filename,
38339
38223
  displayErrors: true,
38340
38224
  timeout: 2e4
@@ -38392,8 +38276,7 @@ const createTokens = async ({ body, iss, clientID, audience, rulesDirectory, sco
38392
38276
  else if (grant_type === "refresh_token") {
38393
38277
  let { refresh_token: refreshTokenValue } = body;
38394
38278
  let refreshToken = JSON.parse((0, base64_url.decode)(refreshTokenValue));
38395
- let findUser = createPersonQuery(simulationStore);
38396
- user = findUser((person) => person.id === refreshToken.user.id);
38279
+ user = createPersonQuery(simulationStore)((person) => person.id === refreshToken.user.id);
38397
38280
  nonce = refreshToken.nonce;
38398
38281
  (0, assert_ts.assert)(!!nonce, `400::No nonce in request`);
38399
38282
  } else {
@@ -38421,8 +38304,7 @@ const createTokens = async ({ body, iss, clientID, audience, rulesDirectory, sco
38421
38304
  },
38422
38305
  idToken: idTokenData
38423
38306
  };
38424
- let rulesRunner = createRulesRunner(rulesDirectory);
38425
- await rulesRunner(userData, context);
38307
+ await createRulesRunner(rulesDirectory)(userData, context);
38426
38308
  return {
38427
38309
  access_token: createJsonWebToken({
38428
38310
  ...accessToken,
@@ -38508,7 +38390,13 @@ const verifyUserExistsInStore = ({ simulationStore, body, grant_type }) => {
38508
38390
  //#endregion
38509
38391
  //#region src/views/username-password.ts
38510
38392
  const userNamePasswordForm = ({ auth0Domain = "/login/callback", redirect_uri, state, nonce, client_id, scope, audience, connection, response_type, tenant }) => {
38511
- let wctx = (0, html_entities.encode)(JSON.stringify({
38393
+ return `
38394
+ <form method="post" name="hiddenform" action="${auth0Domain}">
38395
+ <input type="hidden" name="wa" value="wsignin1.0">
38396
+ <input type="hidden"
38397
+ name="wresult"
38398
+ value="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VyX2lkIjoiNjA1MzhjYWQ2YWI5ODQwMDY5OWIxZDZhIiwiZW1haWwiOiJpbXJhbi5zdWxlbWFuamlAcmVzaWRlby5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInNpZCI6Im5zSHZTQ0lYT2NGSUZINUIyRzdVdUFEWDVQTlR4cmRPIiwiaWF0IjoxNjE2MTU0ODA0LCJleHAiOjE2MTYxNTQ4NjQsImF1ZCI6InVybjphdXRoMDpyZXNpZGVvOlVzZXJuYW1lLVBhc3N3b3JkLUF1dGhlbnRpY2F0aW9uIiwiaXNzIjoidXJuOmF1dGgwIn0.CTl0A1hDc4YrErsrFBCCEG0ekIUU3bv0x12p_vUgoyD6zOg_QhaSZjKeZI2elaeYnAi7KUcohgOP9TApj3VlQtm6GlGNuWIiQke4866FtfhufGo2_uLBWyf4nmOgbNcmhpIg2bvVJHUqM-6OCNfnzPWAoFW2_g-DeIo20WBfK2E">
38399
+ <input type="hidden" name="wctx" value="${(0, html_entities.encode)(JSON.stringify({
38512
38400
  strategy: "auth0",
38513
38401
  tenant,
38514
38402
  connection,
@@ -38520,14 +38408,7 @@ const userNamePasswordForm = ({ auth0Domain = "/login/callback", redirect_uri, s
38520
38408
  nonce,
38521
38409
  audience,
38522
38410
  realm: connection
38523
- }));
38524
- return `
38525
- <form method="post" name="hiddenform" action="${auth0Domain}">
38526
- <input type="hidden" name="wa" value="wsignin1.0">
38527
- <input type="hidden"
38528
- name="wresult"
38529
- value="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VyX2lkIjoiNjA1MzhjYWQ2YWI5ODQwMDY5OWIxZDZhIiwiZW1haWwiOiJpbXJhbi5zdWxlbWFuamlAcmVzaWRlby5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInNpZCI6Im5zSHZTQ0lYT2NGSUZINUIyRzdVdUFEWDVQTlR4cmRPIiwiaWF0IjoxNjE2MTU0ODA0LCJleHAiOjE2MTYxNTQ4NjQsImF1ZCI6InVybjphdXRoMDpyZXNpZGVvOlVzZXJuYW1lLVBhc3N3b3JkLUF1dGhlbnRpY2F0aW9uIiwiaXNzIjoidXJuOmF1dGgwIn0.CTl0A1hDc4YrErsrFBCCEG0ekIUU3bv0x12p_vUgoyD6zOg_QhaSZjKeZI2elaeYnAi7KUcohgOP9TApj3VlQtm6GlGNuWIiQke4866FtfhufGo2_uLBWyf4nmOgbNcmhpIg2bvVJHUqM-6OCNfnzPWAoFW2_g-DeIo20WBfK2E">
38530
- <input type="hidden" name="wctx" value="${wctx}">
38411
+ }))}">
38531
38412
  <noscript>
38532
38413
  <p>
38533
38414
  Script is disabled. Click Submit to continue.
@@ -38598,8 +38479,7 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
38598
38479
  (0, assert_ts.assert)(!!username, "no username in /usernamepassword/login");
38599
38480
  (0, assert_ts.assert)(!!nonce, "no nonce in /usernamepassword/login");
38600
38481
  (0, assert_ts.assert)(!!req$2.session, "no session");
38601
- let user = personQuery((person) => person.email?.toLowerCase() === username.toLowerCase() && person.password === password);
38602
- if (!user) {
38482
+ if (!personQuery((person) => person.email?.toLowerCase() === username.toLowerCase() && person.password === password)) {
38603
38483
  let query = req$2.query;
38604
38484
  let responseClientId = query.client_id ?? clientID;
38605
38485
  let responseAudience = query.audience ?? audience;
@@ -38631,14 +38511,11 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
38631
38511
  wctx
38632
38512
  } });
38633
38513
  let { redirect_uri, nonce } = wctx;
38634
- const session = simulationStore.schema.sessions.selectById(simulationStore.store.getState(), { id: nonce });
38635
- const { username } = session ?? {};
38636
- let encodedNonce = (0, base64_url.encode)(`${nonce}:${username}`);
38637
- let qs$2 = (0, querystring.stringify)({
38638
- code: encodedNonce,
38514
+ const { username } = simulationStore.schema.sessions.selectById(simulationStore.store.getState(), { id: nonce }) ?? {};
38515
+ let routerUrl = `${redirect_uri}?${(0, querystring.stringify)({
38516
+ code: (0, base64_url.encode)(`${nonce}:${username}`),
38639
38517
  ...wctx
38640
- });
38641
- let routerUrl = `${redirect_uri}?${qs$2}`;
38518
+ })}`;
38642
38519
  res$2.redirect(302, routerUrl);
38643
38520
  },
38644
38521
  ["/oauth/token"]: async function(req$2, res$2, next) {
@@ -38677,10 +38554,8 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
38677
38554
  },
38678
38555
  ["/userinfo"]: function(req$2, res$2) {
38679
38556
  let token = null;
38680
- if (req$2.headers.authorization) {
38681
- let authorizationHeader = req$2.headers.authorization;
38682
- token = authorizationHeader?.split(" ")?.[1];
38683
- } else token = req$2?.query?.access_token;
38557
+ if (req$2.headers.authorization) token = req$2.headers.authorization?.split(" ")?.[1];
38558
+ else token = req$2?.query?.access_token;
38684
38559
  (0, assert_ts.assert)(!!token, "no authorization header or access_token");
38685
38560
  let { sub } = (0, jsonwebtoken.decode)(token, { json: true });
38686
38561
  let user = personQuery((person) => {
@@ -38703,7 +38578,7 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
38703
38578
  ["/passwordless/start"]: function(req$2, res$2, next) {
38704
38579
  logger.log({ "/passwordless/start": { body: req$2.body } });
38705
38580
  try {
38706
- const { client_id, connection, email, phone_number, send: send$4 } = req$2.body;
38581
+ const { client_id, connection, email, phone_number } = req$2.body;
38707
38582
  if (!client_id) {
38708
38583
  res$2.status(400).json({ error: "client_id is required" });
38709
38584
  return;
@@ -38792,11 +38667,13 @@ const configurationSchema = zod.z.object({
38792
38667
  //#endregion
38793
38668
  //#region src/handlers/index.ts
38794
38669
  const publicDir = path.default.join(__dirname, "..", "views", "public");
38795
- const extendRouter = (config, debug$11 = false) => (router, simulationStore) => {
38670
+ const extendRouter = (config, extend, debug$11 = false) => (router, simulationStore) => {
38796
38671
  const serviceURL = (request) => `${request.protocol}://${request.get("Host")}/`;
38797
38672
  const auth0 = createAuth0Handlers(simulationStore, serviceURL, config, debug$11);
38798
38673
  const openid = createOpenIdHandlers(serviceURL);
38799
- router.use(import_express.static(publicDir)).use(createSession()).use(createCors()).use(noCache()).get("/health", (_, response) => {
38674
+ router.use(import_express.static(publicDir)).use(createSession()).use(createCors()).use(noCache());
38675
+ if (extend) extend(router, simulationStore);
38676
+ router.get("/health", (_, response) => {
38800
38677
  response.send({ status: "ok" });
38801
38678
  }).get("/heartbeat", auth0["/heartbeat"]).get("/authorize", auth0["/authorize"]).get("/login", auth0["/login"]).get("/u/login", auth0["/usernamepassword/login"]).post("/usernamepassword/login", auth0["/usernamepassword/login"]).post("/login/callback", auth0["/login/callback"]).post("/oauth/token", auth0["/oauth/token"]).post("/passwordless/start", auth0["/passwordless/start"]).get("/userinfo", auth0["/userinfo"]).get("/v2/logout", auth0["/v2/logout"]).get("/.well-known/jwks.json", openid["/.well-known/jwks.json"]).get("/.well-known/openid-configuration", openid["/.well-known/openid-configuration"]);
38802
38679
  router.use(defaultErrorHandler);
@@ -38842,10 +38719,10 @@ const simulation = (args = {}) => {
38842
38719
  const config = getConfig(args.options);
38843
38720
  const parsedInitialState = !args?.initialState ? void 0 : auth0InitialStoreSchema.parse(args?.initialState);
38844
38721
  return (0, __simulacrum_foundation_simulator.createFoundationSimulationServer)({
38845
- port: 4400,
38722
+ port: config.port ?? 4400,
38846
38723
  protocol: "https",
38847
38724
  extendStore: extendStore(parsedInitialState, args?.extend?.extendStore),
38848
- extendRouter: extendRouter(config, args.debug)
38725
+ extendRouter: extendRouter(config, args.extend?.extendRouter, args.debug)
38849
38726
  })();
38850
38727
  };
38851
38728