@rpcbase/api 0.163.0 → 0.164.0

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.js CHANGED
@@ -53,7 +53,7 @@ var __copyProps = (to, from, except, desc) => {
53
53
  }
54
54
  return to;
55
55
  };
56
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
56
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
57
57
  value: mod,
58
58
  enumerable: true
59
59
  }) : target, mod));
@@ -362,11 +362,12 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
362
362
  Promise.prototype.get = function(propertyName) {
363
363
  var isIndex = typeof propertyName === "number";
364
364
  var getter;
365
- if (!isIndex) if (canEvaluate) {
366
- var maybeGetter = getGetter(propertyName);
367
- getter = maybeGetter !== null ? maybeGetter : namedGetter;
368
- } else getter = namedGetter;
369
- else getter = indexedGetter;
365
+ if (!isIndex) {
366
+ if (canEvaluate) {
367
+ var maybeGetter = getGetter(propertyName);
368
+ getter = maybeGetter !== null ? maybeGetter : namedGetter;
369
+ } else getter = namedGetter;
370
+ } else getter = indexedGetter;
370
371
  return this._then(getter, void 0, void 0, propertyName, void 0);
371
372
  };
372
373
  };
@@ -443,15 +444,17 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
443
444
  };
444
445
  Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {
445
446
  if (util.isArray(onCancelCallback)) for (var i = 0; i < onCancelCallback.length; ++i) this._doInvokeOnCancel(onCancelCallback[i], internalOnly);
446
- else if (onCancelCallback !== void 0) if (typeof onCancelCallback === "function") {
447
- if (!internalOnly) {
448
- var e = tryCatch(onCancelCallback).call(this._boundValue());
449
- if (e === errorObj) {
450
- this._attachExtraTrace(e.e);
451
- async.throwLater(e.e);
447
+ else if (onCancelCallback !== void 0) {
448
+ if (typeof onCancelCallback === "function") {
449
+ if (!internalOnly) {
450
+ var e = tryCatch(onCancelCallback).call(this._boundValue());
451
+ if (e === errorObj) {
452
+ this._attachExtraTrace(e.e);
453
+ async.throwLater(e.e);
454
+ }
452
455
  }
453
- }
454
- } else onCancelCallback._resultCancelled(this);
456
+ } else onCancelCallback._resultCancelled(this);
457
+ }
455
458
  };
456
459
  Promise.prototype._invokeOnCancel = function() {
457
460
  var onCancelCallback = this._onCancel();
@@ -904,9 +907,10 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
904
907
  function cancellationAttachCancellationCallback(onCancel) {
905
908
  if (!this._isCancellable()) return this;
906
909
  var previousOnCancel = this._onCancel();
907
- if (previousOnCancel !== void 0) if (util.isArray(previousOnCancel)) previousOnCancel.push(onCancel);
908
- else this._setOnCancel([previousOnCancel, onCancel]);
909
- else this._setOnCancel(onCancel);
910
+ if (previousOnCancel !== void 0) {
911
+ if (util.isArray(previousOnCancel)) previousOnCancel.push(onCancel);
912
+ else this._setOnCancel([previousOnCancel, onCancel]);
913
+ } else this._setOnCancel(onCancel);
910
914
  }
911
915
  function cancellationOnCancel() {
912
916
  return this._onCancelField;
@@ -934,8 +938,10 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
934
938
  function boundValueFunction() {
935
939
  var ret = this._boundTo;
936
940
  if (ret !== void 0) {
937
- if (ret instanceof Promise) if (ret.isFulfilled()) return ret.value();
938
- else return;
941
+ if (ret instanceof Promise) {
942
+ if (ret.isFulfilled()) return ret.value();
943
+ else return;
944
+ }
939
945
  }
940
946
  return ret;
941
947
  }
@@ -1978,10 +1984,12 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1978
1984
  function map(promises, fn, options, _filter) {
1979
1985
  if (typeof fn !== "function") return apiRejection("expecting a function but got " + util.classString(fn));
1980
1986
  var limit = 0;
1981
- if (options !== void 0) if (typeof options === "object" && options !== null) {
1982
- if (typeof options.concurrency !== "number") return Promise.reject(/* @__PURE__ */ new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency)));
1983
- limit = options.concurrency;
1984
- } else return Promise.reject(/* @__PURE__ */ new TypeError("options argument must be an object but it is " + util.classString(options)));
1987
+ if (options !== void 0) {
1988
+ if (typeof options === "object" && options !== null) {
1989
+ if (typeof options.concurrency !== "number") return Promise.reject(/* @__PURE__ */ new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency)));
1990
+ limit = options.concurrency;
1991
+ } else return Promise.reject(/* @__PURE__ */ new TypeError("options argument must be an object but it is " + util.classString(options)));
1992
+ }
1985
1993
  limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0;
1986
1994
  return new MappingPromiseArray(promises, fn, limit, _filter).promise();
1987
1995
  }
@@ -2313,8 +2321,10 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2313
2321
  if (!haveInternalData) {
2314
2322
  promise._propagateFrom(this, 3);
2315
2323
  promise._captureStackTrace();
2316
- if (receiver === void 0 && (this._bitField & 2097152) !== 0) if (!((bitField & 50397184) === 0)) receiver = this._boundValue();
2317
- else receiver = target === this ? void 0 : this._boundTo;
2324
+ if (receiver === void 0 && (this._bitField & 2097152) !== 0) {
2325
+ if (!((bitField & 50397184) === 0)) receiver = this._boundValue();
2326
+ else receiver = target === this ? void 0 : this._boundTo;
2327
+ }
2318
2328
  this._fireEvent("promiseChained", this, promise);
2319
2329
  }
2320
2330
  var context = getContext();
@@ -2504,11 +2514,12 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2504
2514
  if ((bitField & 65536) !== 0) return;
2505
2515
  promise._pushContext();
2506
2516
  var x;
2507
- if (receiver === APPLY) if (!value || typeof value.length !== "number") {
2508
- x = errorObj;
2509
- x.e = new TypeError("cannot .spread() a non-array: " + util.classString(value));
2510
- } else x = tryCatch(handler).apply(this._boundValue(), value);
2511
- else x = tryCatch(handler).call(receiver, value);
2517
+ if (receiver === APPLY) {
2518
+ if (!value || typeof value.length !== "number") {
2519
+ x = errorObj;
2520
+ x.e = new TypeError("cannot .spread() a non-array: " + util.classString(value));
2521
+ } else x = tryCatch(handler).apply(this._boundValue(), value);
2522
+ } else x = tryCatch(handler).call(receiver, value);
2512
2523
  var promiseCreated = promise._popContext();
2513
2524
  bitField = promise._bitField;
2514
2525
  if ((bitField & 65536) !== 0) return;
@@ -2543,14 +2554,17 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2543
2554
  else if (receiver instanceof Proxyable) receiver._promiseCancelled(promise);
2544
2555
  else if (isPromise || promise instanceof PromiseArray) promise._cancel();
2545
2556
  else receiver.cancel();
2546
- } else if (typeof handler === "function") if (!isPromise) handler.call(receiver, value, promise);
2547
- else {
2548
- if (asyncGuaranteed) promise._setAsyncGuaranteed();
2549
- this._settlePromiseFromHandler(handler, receiver, value, promise);
2550
- }
2551
- else if (receiver instanceof Proxyable) {
2552
- if (!receiver._isResolved()) if ((bitField & 33554432) !== 0) receiver._promiseFulfilled(value, promise);
2553
- else receiver._promiseRejected(value, promise);
2557
+ } else if (typeof handler === "function") {
2558
+ if (!isPromise) handler.call(receiver, value, promise);
2559
+ else {
2560
+ if (asyncGuaranteed) promise._setAsyncGuaranteed();
2561
+ this._settlePromiseFromHandler(handler, receiver, value, promise);
2562
+ }
2563
+ } else if (receiver instanceof Proxyable) {
2564
+ if (!receiver._isResolved()) {
2565
+ if ((bitField & 33554432) !== 0) receiver._promiseFulfilled(value, promise);
2566
+ else receiver._promiseRejected(value, promise);
2567
+ }
2554
2568
  } else if (isPromise) {
2555
2569
  if (asyncGuaranteed) promise._setAsyncGuaranteed();
2556
2570
  if ((bitField & 33554432) !== 0) promise._fulfill(value);
@@ -2562,9 +2576,10 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2562
2576
  var promise = ctx.promise;
2563
2577
  var receiver = ctx.receiver;
2564
2578
  var value = ctx.value;
2565
- if (typeof handler === "function") if (!(promise instanceof Promise)) handler.call(receiver, value, promise);
2566
- else this._settlePromiseFromHandler(handler, receiver, value, promise);
2567
- else if (promise instanceof Promise) promise._reject(value);
2579
+ if (typeof handler === "function") {
2580
+ if (!(promise instanceof Promise)) handler.call(receiver, value, promise);
2581
+ else this._settlePromiseFromHandler(handler, receiver, value, promise);
2582
+ } else if (promise instanceof Promise) promise._reject(value);
2568
2583
  };
2569
2584
  Promise.prototype._settlePromiseCtx = function(ctx) {
2570
2585
  this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);
@@ -2813,13 +2828,14 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2813
2828
  } else bitField = null;
2814
2829
  if (isResolved) {
2815
2830
  if (bitField !== null) maybePromise.suppressUnhandledRejections();
2816
- } else if (bitField !== null) if ((bitField & 50397184) === 0) {
2817
- maybePromise._proxy(this, i);
2818
- this._values[i] = maybePromise;
2819
- } else if ((bitField & 33554432) !== 0) isResolved = this._promiseFulfilled(maybePromise._value(), i);
2820
- else if ((bitField & 16777216) !== 0) isResolved = this._promiseRejected(maybePromise._reason(), i);
2821
- else isResolved = this._promiseCancelled(i);
2822
- else isResolved = this._promiseFulfilled(maybePromise, i);
2831
+ } else if (bitField !== null) {
2832
+ if ((bitField & 50397184) === 0) {
2833
+ maybePromise._proxy(this, i);
2834
+ this._values[i] = maybePromise;
2835
+ } else if ((bitField & 33554432) !== 0) isResolved = this._promiseFulfilled(maybePromise._value(), i);
2836
+ else if ((bitField & 16777216) !== 0) isResolved = this._promiseRejected(maybePromise._reason(), i);
2837
+ else isResolved = this._promiseCancelled(i);
2838
+ } else isResolved = this._promiseFulfilled(maybePromise, i);
2823
2839
  }
2824
2840
  if (!isResolved) result._setAsyncGuaranteed();
2825
2841
  };
@@ -3714,9 +3730,10 @@ var require_bluebird = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3714
3730
  };
3715
3731
  var afterTimeout = function(promise, message, parent) {
3716
3732
  var err;
3717
- if (typeof message !== "string") if (message instanceof Error) err = message;
3718
- else err = new TimeoutError("operation timed out");
3719
- else err = new TimeoutError(message);
3733
+ if (typeof message !== "string") {
3734
+ if (message instanceof Error) err = message;
3735
+ else err = new TimeoutError("operation timed out");
3736
+ } else err = new TimeoutError(message);
3720
3737
  util.markAsOriginatingFromRejection(err);
3721
3738
  promise._attachExtraTrace(err);
3722
3739
  promise._reject(err);
@@ -4492,15 +4509,16 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4492
4509
  let templateIndex = 0;
4493
4510
  let starIndex = -1;
4494
4511
  let matchIndex = 0;
4495
- while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
4496
- starIndex = templateIndex;
4497
- matchIndex = searchIndex;
4498
- templateIndex++;
4499
- } else {
4500
- searchIndex++;
4501
- templateIndex++;
4502
- }
4503
- else if (starIndex !== -1) {
4512
+ while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
4513
+ if (template[templateIndex] === "*") {
4514
+ starIndex = templateIndex;
4515
+ matchIndex = searchIndex;
4516
+ templateIndex++;
4517
+ } else {
4518
+ searchIndex++;
4519
+ templateIndex++;
4520
+ }
4521
+ } else if (starIndex !== -1) {
4504
4522
  templateIndex = starIndex + 1;
4505
4523
  matchIndex++;
4506
4524
  searchIndex = matchIndex;
@@ -5214,9 +5232,7 @@ var require_http_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5214
5232
  case 400:
5215
5233
  CodeError = createClientErrorConstructor(HttpError, name, code);
5216
5234
  break;
5217
- case 500:
5218
- CodeError = createServerErrorConstructor(HttpError, name, code);
5219
- break;
5235
+ case 500: CodeError = createServerErrorConstructor(HttpError, name, code);
5220
5236
  }
5221
5237
  if (CodeError) {
5222
5238
  exports$1[code] = CodeError;
@@ -5310,12 +5326,14 @@ var require_bytes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5310
5326
  var decimalPlaces = options && options.decimalPlaces !== void 0 ? options.decimalPlaces : 2;
5311
5327
  var fixedDecimals = Boolean(options && options.fixedDecimals);
5312
5328
  var unit = options && options.unit || "";
5313
- if (!unit || !map[unit.toLowerCase()]) if (mag >= map.pb) unit = "PB";
5314
- else if (mag >= map.tb) unit = "TB";
5315
- else if (mag >= map.gb) unit = "GB";
5316
- else if (mag >= map.mb) unit = "MB";
5317
- else if (mag >= map.kb) unit = "KB";
5318
- else unit = "B";
5329
+ if (!unit || !map[unit.toLowerCase()]) {
5330
+ if (mag >= map.pb) unit = "PB";
5331
+ else if (mag >= map.tb) unit = "TB";
5332
+ else if (mag >= map.gb) unit = "GB";
5333
+ else if (mag >= map.mb) unit = "MB";
5334
+ else if (mag >= map.kb) unit = "KB";
5335
+ else unit = "B";
5336
+ }
5319
5337
  var str = (value / map[unit.toLowerCase()]).toFixed(decimalPlaces);
5320
5338
  if (!fixedDecimals) str = str.replace(formatDecimalsRegExp, "$1");
5321
5339
  if (thousandsSeparator) str = str.split(".").map(function(s, i) {
@@ -5572,9 +5590,11 @@ var require_internal = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5572
5590
  acc = acc << 6 | curByte & 63;
5573
5591
  contBytes--;
5574
5592
  accBytes++;
5575
- if (contBytes === 0) if (accBytes === 2 && acc < 128 && acc > 0) res += this.defaultCharUnicode;
5576
- else if (accBytes === 3 && acc < 2048) res += this.defaultCharUnicode;
5577
- else res += String.fromCharCode(acc);
5593
+ if (contBytes === 0) {
5594
+ if (accBytes === 2 && acc < 128 && acc > 0) res += this.defaultCharUnicode;
5595
+ else if (accBytes === 3 && acc < 2048) res += this.defaultCharUnicode;
5596
+ else res += String.fromCharCode(acc);
5597
+ }
5578
5598
  } else res += this.defaultCharUnicode;
5579
5599
  }
5580
5600
  this.acc = acc;
@@ -5647,15 +5667,17 @@ var require_utf32 = /* @__PURE__ */ __commonJSMin(((exports) => {
5647
5667
  var code = src.readUInt16LE(i);
5648
5668
  var isHighSurrogate = code >= 55296 && code < 56320;
5649
5669
  var isLowSurrogate = code >= 56320 && code < 57344;
5650
- if (this.highSurrogate) if (isHighSurrogate || !isLowSurrogate) {
5651
- write32.call(dst, this.highSurrogate, offset);
5652
- offset += 4;
5653
- } else {
5654
- var codepoint = (this.highSurrogate - 55296 << 10 | code - 56320) + 65536;
5655
- write32.call(dst, codepoint, offset);
5656
- offset += 4;
5657
- this.highSurrogate = 0;
5658
- continue;
5670
+ if (this.highSurrogate) {
5671
+ if (isHighSurrogate || !isLowSurrogate) {
5672
+ write32.call(dst, this.highSurrogate, offset);
5673
+ offset += 4;
5674
+ } else {
5675
+ var codepoint = (this.highSurrogate - 55296 << 10 | code - 56320) + 65536;
5676
+ write32.call(dst, codepoint, offset);
5677
+ offset += 4;
5678
+ this.highSurrogate = 0;
5679
+ continue;
5680
+ }
5659
5681
  }
5660
5682
  if (isHighSurrogate) this.highSurrogate = code;
5661
5683
  else {
@@ -6950,18 +6972,20 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJSMin(((exports) => {
6950
6972
  var uCode = nextChar;
6951
6973
  nextChar = -1;
6952
6974
  }
6953
- if (uCode >= 55296 && uCode < 57344) if (uCode < 56320) if (leadSurrogate === -1) {
6954
- leadSurrogate = uCode;
6955
- continue;
6956
- } else {
6957
- leadSurrogate = uCode;
6958
- uCode = UNASSIGNED;
6959
- }
6960
- else if (leadSurrogate !== -1) {
6961
- uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320);
6962
- leadSurrogate = -1;
6963
- } else uCode = UNASSIGNED;
6964
- else if (leadSurrogate !== -1) {
6975
+ if (uCode >= 55296 && uCode < 57344) {
6976
+ if (uCode < 56320) {
6977
+ if (leadSurrogate === -1) {
6978
+ leadSurrogate = uCode;
6979
+ continue;
6980
+ } else {
6981
+ leadSurrogate = uCode;
6982
+ uCode = UNASSIGNED;
6983
+ }
6984
+ } else if (leadSurrogate !== -1) {
6985
+ uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320);
6986
+ leadSurrogate = -1;
6987
+ } else uCode = UNASSIGNED;
6988
+ } else if (leadSurrogate !== -1) {
6965
6989
  nextChar = uCode;
6966
6990
  uCode = UNASSIGNED;
6967
6991
  leadSurrogate = -1;
@@ -7029,10 +7053,12 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJSMin(((exports) => {
7029
7053
  var j = 0;
7030
7054
  if (this.seqObj) {
7031
7055
  var dbcsCode = this.seqObj[DEF_CHAR];
7032
- if (dbcsCode !== void 0) if (dbcsCode < 256) newBuf[j++] = dbcsCode;
7033
- else {
7034
- newBuf[j++] = dbcsCode >> 8;
7035
- newBuf[j++] = dbcsCode & 255;
7056
+ if (dbcsCode !== void 0) {
7057
+ if (dbcsCode < 256) newBuf[j++] = dbcsCode;
7058
+ else {
7059
+ newBuf[j++] = dbcsCode >> 8;
7060
+ newBuf[j++] = dbcsCode & 255;
7061
+ }
7036
7062
  }
7037
7063
  this.seqObj = void 0;
7038
7064
  }
@@ -8718,7 +8744,7 @@ var require_builtin_esm_external_require_node_zlib = /* @__PURE__ */ __commonJSM
8718
8744
  }));
8719
8745
  //#endregion
8720
8746
  //#region ../../node_modules/type-is/node_modules/content-type/dist/index.js
8721
- var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
8747
+ var require_dist$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
8722
8748
  /*!
8723
8749
  * content-type
8724
8750
  * Copyright(c) 2015 Douglas Christopher Wilson
@@ -8766,15 +8792,19 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
8766
8792
  * Parse a `Content-Type` header.
8767
8793
  */
8768
8794
  function parse(header, options) {
8795
+ const stopChar = options?.comma === true ? COMMA : 65536;
8769
8796
  const len = header.length;
8770
- let index = skipOWS(header, 0, len);
8797
+ let index = skipOWS(header, options?.start ?? 0, len);
8771
8798
  const valueStart = index;
8772
- index = skipValue(header, index, len);
8799
+ index = skipValue(header, index, len, stopChar);
8773
8800
  const valueEnd = trailingOWS(header, valueStart, index);
8774
- return {
8775
- type: header.slice(valueStart, valueEnd).toLowerCase(),
8776
- parameters: options?.parameters === false ? new NullObject() : parseParameters(header, index, len)
8801
+ const type = header.slice(valueStart, valueEnd).toLowerCase();
8802
+ if (options?.parameters === false) return {
8803
+ type,
8804
+ index,
8805
+ parameters: new NullObject()
8777
8806
  };
8807
+ return parseParameters(header, type, index, len, stopChar);
8778
8808
  }
8779
8809
  var SP = 32;
8780
8810
  var HTAB = 9;
@@ -8782,16 +8812,19 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
8782
8812
  var EQ = 61;
8783
8813
  var DQUOTE = 34;
8784
8814
  var BSLASH = 92;
8815
+ var COMMA = 44;
8785
8816
  /**
8786
8817
  * Parses the parameters of a `Content-Type` header starting at the given index.
8787
8818
  */
8788
- function parseParameters(header, index, len) {
8819
+ function parseParameters(header, type, index, len, stopChar) {
8789
8820
  const parameters = new NullObject();
8790
8821
  parameter: while (index < len) {
8822
+ if (header.charCodeAt(index) === stopChar) break;
8791
8823
  index = skipOWS(header, index + 1, len);
8792
8824
  const keyStart = index;
8793
8825
  while (index < len) {
8794
8826
  const code = header.charCodeAt(index);
8827
+ if (code === stopChar) break parameter;
8795
8828
  if (code === SEMI) continue parameter;
8796
8829
  if (code === EQ) {
8797
8830
  const keyEnd = trailingOWS(header, keyStart, index);
@@ -8803,7 +8836,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
8803
8836
  while (index < len) {
8804
8837
  const code = header.charCodeAt(index++);
8805
8838
  if (code === DQUOTE) {
8806
- index = skipValue(header, index, len);
8839
+ index = skipValue(header, index, len, stopChar);
8807
8840
  if (parameters[key] === void 0) parameters[key] = value;
8808
8841
  break;
8809
8842
  }
@@ -8816,7 +8849,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
8816
8849
  continue parameter;
8817
8850
  }
8818
8851
  const valueStart = index;
8819
- index = skipValue(header, index, len);
8852
+ index = skipValue(header, index, len, stopChar);
8820
8853
  if (parameters[key] === void 0) {
8821
8854
  const valueEnd = trailingOWS(header, valueStart, index);
8822
8855
  parameters[key] = header.slice(valueStart, valueEnd);
@@ -8826,14 +8859,19 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
8826
8859
  index++;
8827
8860
  }
8828
8861
  }
8829
- return parameters;
8862
+ return {
8863
+ type,
8864
+ index,
8865
+ parameters
8866
+ };
8830
8867
  }
8831
8868
  /**
8832
- * Skip over characters until a semicolon.
8869
+ * Skip over characters until a semicolon or other exit character.
8833
8870
  */
8834
- function skipValue(str, index, len) {
8871
+ function skipValue(str, index, len, stopChar) {
8835
8872
  while (index < len) {
8836
- if (str.charCodeAt(index) === SEMI) break;
8873
+ const code = str.charCodeAt(index);
8874
+ if (code === SEMI || code === stopChar) break;
8837
8875
  index++;
8838
8876
  }
8839
8877
  return index;
@@ -16792,7 +16830,7 @@ var require_type_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16792
16830
  * Module dependencies.
16793
16831
  * @private
16794
16832
  */
16795
- var contentType = require_dist$2();
16833
+ var contentType = require_dist$3();
16796
16834
  var mime = require_mime_types();
16797
16835
  var typer = require_media_typer();
16798
16836
  /**
@@ -16937,7 +16975,7 @@ var require_type_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16937
16975
  }));
16938
16976
  //#endregion
16939
16977
  //#region ../../node_modules/body-parser/node_modules/content-type/dist/index.js
16940
- var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
16978
+ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
16941
16979
  /*!
16942
16980
  * content-type
16943
16981
  * Copyright(c) 2015 Douglas Christopher Wilson
@@ -16985,15 +17023,19 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
16985
17023
  * Parse a `Content-Type` header.
16986
17024
  */
16987
17025
  function parse(header, options) {
17026
+ const stopChar = options?.comma === true ? COMMA : 65536;
16988
17027
  const len = header.length;
16989
- let index = skipOWS(header, 0, len);
17028
+ let index = skipOWS(header, options?.start ?? 0, len);
16990
17029
  const valueStart = index;
16991
- index = skipValue(header, index, len);
17030
+ index = skipValue(header, index, len, stopChar);
16992
17031
  const valueEnd = trailingOWS(header, valueStart, index);
16993
- return {
16994
- type: header.slice(valueStart, valueEnd).toLowerCase(),
16995
- parameters: options?.parameters === false ? new NullObject() : parseParameters(header, index, len)
17032
+ const type = header.slice(valueStart, valueEnd).toLowerCase();
17033
+ if (options?.parameters === false) return {
17034
+ type,
17035
+ index,
17036
+ parameters: new NullObject()
16996
17037
  };
17038
+ return parseParameters(header, type, index, len, stopChar);
16997
17039
  }
16998
17040
  var SP = 32;
16999
17041
  var HTAB = 9;
@@ -17001,16 +17043,19 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
17001
17043
  var EQ = 61;
17002
17044
  var DQUOTE = 34;
17003
17045
  var BSLASH = 92;
17046
+ var COMMA = 44;
17004
17047
  /**
17005
17048
  * Parses the parameters of a `Content-Type` header starting at the given index.
17006
17049
  */
17007
- function parseParameters(header, index, len) {
17050
+ function parseParameters(header, type, index, len, stopChar) {
17008
17051
  const parameters = new NullObject();
17009
17052
  parameter: while (index < len) {
17053
+ if (header.charCodeAt(index) === stopChar) break;
17010
17054
  index = skipOWS(header, index + 1, len);
17011
17055
  const keyStart = index;
17012
17056
  while (index < len) {
17013
17057
  const code = header.charCodeAt(index);
17058
+ if (code === stopChar) break parameter;
17014
17059
  if (code === SEMI) continue parameter;
17015
17060
  if (code === EQ) {
17016
17061
  const keyEnd = trailingOWS(header, keyStart, index);
@@ -17022,7 +17067,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
17022
17067
  while (index < len) {
17023
17068
  const code = header.charCodeAt(index++);
17024
17069
  if (code === DQUOTE) {
17025
- index = skipValue(header, index, len);
17070
+ index = skipValue(header, index, len, stopChar);
17026
17071
  if (parameters[key] === void 0) parameters[key] = value;
17027
17072
  break;
17028
17073
  }
@@ -17035,7 +17080,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
17035
17080
  continue parameter;
17036
17081
  }
17037
17082
  const valueStart = index;
17038
- index = skipValue(header, index, len);
17083
+ index = skipValue(header, index, len, stopChar);
17039
17084
  if (parameters[key] === void 0) {
17040
17085
  const valueEnd = trailingOWS(header, valueStart, index);
17041
17086
  parameters[key] = header.slice(valueStart, valueEnd);
@@ -17045,14 +17090,19 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
17045
17090
  index++;
17046
17091
  }
17047
17092
  }
17048
- return parameters;
17093
+ return {
17094
+ type,
17095
+ index,
17096
+ parameters
17097
+ };
17049
17098
  }
17050
17099
  /**
17051
- * Skip over characters until a semicolon.
17100
+ * Skip over characters until a semicolon or other exit character.
17052
17101
  */
17053
- function skipValue(str, index, len) {
17102
+ function skipValue(str, index, len, stopChar) {
17054
17103
  while (index < len) {
17055
- if (str.charCodeAt(index) === SEMI) break;
17104
+ const code = str.charCodeAt(index);
17105
+ if (code === SEMI || code === stopChar) break;
17056
17106
  index++;
17057
17107
  }
17058
17108
  return index;
@@ -17099,7 +17149,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17099
17149
  * Module dependencies.
17100
17150
  */
17101
17151
  var bytes = require_bytes();
17102
- var contentType = require_dist$1();
17152
+ var contentType = require_dist$2();
17103
17153
  var typeis = require_type_is();
17104
17154
  /**
17105
17155
  * Module exports.
@@ -19177,8 +19227,10 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19177
19227
  while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
19178
19228
  var pos = tmpSc.get(object);
19179
19229
  step += 1;
19180
- if (typeof pos !== "undefined") if (pos === step) throw new RangeError("Cyclic object value");
19181
- else findFlag = true;
19230
+ if (typeof pos !== "undefined") {
19231
+ if (pos === step) throw new RangeError("Cyclic object value");
19232
+ else findFlag = true;
19233
+ }
19182
19234
  if (typeof tmpSc.get(sentinel) === "undefined") step = 0;
19183
19235
  }
19184
19236
  if (typeof filter === "function") obj = filter(prefix, obj);
@@ -19295,8 +19347,10 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19295
19347
  }
19296
19348
  var joined = keys.join(options.delimiter);
19297
19349
  var prefix = options.addQueryPrefix === true ? "?" : "";
19298
- if (options.charsetSentinel) if (options.charset === "iso-8859-1") prefix += "utf8=%26%2310003%3B" + options.delimiter;
19299
- else prefix += "utf8=%E2%9C%93" + options.delimiter;
19350
+ if (options.charsetSentinel) {
19351
+ if (options.charset === "iso-8859-1") prefix += "utf8=%26%2310003%3B" + options.delimiter;
19352
+ else prefix += "utf8=%E2%9C%93" + options.delimiter;
19353
+ }
19300
19354
  return joined.length > 0 ? prefix + joined : "";
19301
19355
  };
19302
19356
  }));
@@ -19408,9 +19462,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19408
19462
  for (var i = chain.length - 1; i >= 0; --i) {
19409
19463
  var obj;
19410
19464
  var root = chain[i];
19411
- if (root === "[]" && options.parseArrays) if (utils.isOverflow(leaf)) obj = leaf;
19412
- else obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
19413
- else {
19465
+ if (root === "[]" && options.parseArrays) {
19466
+ if (utils.isOverflow(leaf)) obj = leaf;
19467
+ else obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
19468
+ } else {
19414
19469
  obj = options.plainObjects ? { __proto__: null } : {};
19415
19470
  var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
19416
19471
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
@@ -20560,9 +20615,7 @@ var require_forwarded = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20560
20615
  if (start !== end) list.push(header.substring(start, end));
20561
20616
  start = end = i;
20562
20617
  break;
20563
- default:
20564
- start = i;
20565
- break;
20618
+ default: start = i;
20566
20619
  }
20567
20620
  if (start !== end) list.push(header.substring(start, end));
20568
20621
  return list;
@@ -21732,7 +21785,7 @@ var require_is_promise = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21732
21785
  }));
21733
21786
  //#endregion
21734
21787
  //#region ../../node_modules/path-to-regexp/dist/index.js
21735
- var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
21788
+ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
21736
21789
  Object.defineProperty(exports, "__esModule", { value: true });
21737
21790
  exports.PathError = exports.TokenData = void 0;
21738
21791
  exports.parse = parse;
@@ -22111,7 +22164,7 @@ var require_layer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
22111
22164
  * @private
22112
22165
  */
22113
22166
  var isPromise = require_is_promise();
22114
- var pathRegexp = require_dist();
22167
+ var pathRegexp = require_dist$1();
22115
22168
  var debug = require_browser$1()("router:layer");
22116
22169
  var deprecate = require_browser()("router");
22117
22170
  /**
@@ -23154,7 +23207,6 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23154
23207
  configurable: true,
23155
23208
  value: false
23156
23209
  });
23157
- break;
23158
23210
  }
23159
23211
  return this;
23160
23212
  };
@@ -23355,6 +23407,218 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23355
23407
  }
23356
23408
  }));
23357
23409
  //#endregion
23410
+ //#region ../../node_modules/accepts/node_modules/content-type/dist/index.js
23411
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
23412
+ /*!
23413
+ * content-type
23414
+ * Copyright(c) 2015 Douglas Christopher Wilson
23415
+ * MIT Licensed
23416
+ */
23417
+ Object.defineProperty(exports, "__esModule", { value: true });
23418
+ exports.format = format;
23419
+ exports.parse = parse;
23420
+ var TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;
23421
+ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
23422
+ /**
23423
+ * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4
23424
+ */
23425
+ var QUOTE_REGEXP = /[\\"]/g;
23426
+ /**
23427
+ * RegExp to match type in RFC 9110 sec 8.3.1
23428
+ *
23429
+ * media-type = type "/" subtype
23430
+ * type = token
23431
+ * subtype = token
23432
+ */
23433
+ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
23434
+ /**
23435
+ * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.
23436
+ */
23437
+ var NullObject = /* @__PURE__ */ (() => {
23438
+ const C = function() {};
23439
+ C.prototype = Object.create(null);
23440
+ return C;
23441
+ })();
23442
+ /**
23443
+ * Format an object into a `Content-Type` header.
23444
+ */
23445
+ function format(obj) {
23446
+ const { type, parameters } = obj;
23447
+ if (!type || !TYPE_REGEXP.test(type)) throw new TypeError(`Invalid type: ${type}`);
23448
+ let result = type;
23449
+ if (parameters) for (const param of Object.keys(parameters)) {
23450
+ if (!TOKEN_REGEXP.test(param)) throw new TypeError(`Invalid parameter name: ${param}`);
23451
+ result += `; ${param}=${qstring(parameters[param])}`;
23452
+ }
23453
+ return result;
23454
+ }
23455
+ /**
23456
+ * Parse a `Content-Type` header.
23457
+ */
23458
+ function parse(header, options) {
23459
+ const stopChar = options?.comma === true ? COMMA : 65536;
23460
+ const len = header.length;
23461
+ let index = skipOWS(header, options?.start ?? 0, len);
23462
+ const valueStart = index;
23463
+ index = skipValue(header, index, len, stopChar);
23464
+ const valueEnd = trailingOWS(header, valueStart, index);
23465
+ const type = header.slice(valueStart, valueEnd).toLowerCase();
23466
+ if (options?.parameters === false) return {
23467
+ type,
23468
+ index,
23469
+ parameters: new NullObject()
23470
+ };
23471
+ return parseParameters(header, type, index, len, stopChar);
23472
+ }
23473
+ var SP = 32;
23474
+ var HTAB = 9;
23475
+ var SEMI = 59;
23476
+ var EQ = 61;
23477
+ var DQUOTE = 34;
23478
+ var BSLASH = 92;
23479
+ var COMMA = 44;
23480
+ /**
23481
+ * Parses the parameters of a `Content-Type` header starting at the given index.
23482
+ */
23483
+ function parseParameters(header, type, index, len, stopChar) {
23484
+ const parameters = new NullObject();
23485
+ parameter: while (index < len) {
23486
+ if (header.charCodeAt(index) === stopChar) break;
23487
+ index = skipOWS(header, index + 1, len);
23488
+ const keyStart = index;
23489
+ while (index < len) {
23490
+ const code = header.charCodeAt(index);
23491
+ if (code === stopChar) break parameter;
23492
+ if (code === SEMI) continue parameter;
23493
+ if (code === EQ) {
23494
+ const keyEnd = trailingOWS(header, keyStart, index);
23495
+ const key = header.slice(keyStart, keyEnd).toLowerCase();
23496
+ index = skipOWS(header, index + 1, len);
23497
+ if (index < len && header.charCodeAt(index) === DQUOTE) {
23498
+ index++;
23499
+ let value = "";
23500
+ while (index < len) {
23501
+ const code = header.charCodeAt(index++);
23502
+ if (code === DQUOTE) {
23503
+ index = skipValue(header, index, len, stopChar);
23504
+ if (parameters[key] === void 0) parameters[key] = value;
23505
+ break;
23506
+ }
23507
+ if (code === BSLASH && index < len) {
23508
+ value += header[index++];
23509
+ continue;
23510
+ }
23511
+ value += String.fromCharCode(code);
23512
+ }
23513
+ continue parameter;
23514
+ }
23515
+ const valueStart = index;
23516
+ index = skipValue(header, index, len, stopChar);
23517
+ if (parameters[key] === void 0) {
23518
+ const valueEnd = trailingOWS(header, valueStart, index);
23519
+ parameters[key] = header.slice(valueStart, valueEnd);
23520
+ }
23521
+ continue parameter;
23522
+ }
23523
+ index++;
23524
+ }
23525
+ }
23526
+ return {
23527
+ type,
23528
+ index,
23529
+ parameters
23530
+ };
23531
+ }
23532
+ /**
23533
+ * Skip over characters until a semicolon or other exit character.
23534
+ */
23535
+ function skipValue(str, index, len, stopChar) {
23536
+ while (index < len) {
23537
+ const code = str.charCodeAt(index);
23538
+ if (code === SEMI || code === stopChar) break;
23539
+ index++;
23540
+ }
23541
+ return index;
23542
+ }
23543
+ /**
23544
+ * Skip optional whitespace (OWS) in an HTTP header value.
23545
+ *
23546
+ * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
23547
+ */
23548
+ function skipOWS(header, index, len) {
23549
+ while (index < len) {
23550
+ const char = header.charCodeAt(index);
23551
+ if (char !== SP && char !== HTAB) break;
23552
+ index++;
23553
+ }
23554
+ return index;
23555
+ }
23556
+ /**
23557
+ * Trim optional whitespace (OWS) from the end of a substring.
23558
+ *
23559
+ * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
23560
+ */
23561
+ function trailingOWS(header, start, end) {
23562
+ while (end > start) {
23563
+ const char = header.charCodeAt(end - 1);
23564
+ if (char !== SP && char !== HTAB) break;
23565
+ end--;
23566
+ }
23567
+ return end;
23568
+ }
23569
+ /**
23570
+ * Serialize a parameter value.
23571
+ */
23572
+ function qstring(str) {
23573
+ if (TOKEN_REGEXP.test(str)) return str;
23574
+ if (TEXT_REGEXP.test(str)) return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`;
23575
+ throw new TypeError(`Invalid parameter value: ${str}`);
23576
+ }
23577
+ }));
23578
+ //#endregion
23579
+ //#region ../../node_modules/accepts/node_modules/negotiator/lib/accept.js
23580
+ /*!
23581
+ * negotiator
23582
+ * Copyright(c) 2026 Blake Embrey
23583
+ * MIT Licensed
23584
+ */
23585
+ var require_accept = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23586
+ var contentType = require_dist();
23587
+ /**
23588
+ * Module exports.
23589
+ * @private
23590
+ */
23591
+ module.exports = parseAccept;
23592
+ /**
23593
+ * Parse an Accept-style header.
23594
+ * @private
23595
+ */
23596
+ function parseAccept(header) {
23597
+ var values = [];
23598
+ var index = 0;
23599
+ while (index < header.length) {
23600
+ var start = skipOptionalWhitespace(header, index);
23601
+ var parsed = contentType.parse(header, {
23602
+ comma: true,
23603
+ start
23604
+ });
23605
+ parsed.type = header.slice(start, start + parsed.type.length);
23606
+ values.push(parsed);
23607
+ index = parsed.index + 1;
23608
+ }
23609
+ return values;
23610
+ }
23611
+ /**
23612
+ * Skip optional whitespace.
23613
+ * @private
23614
+ */
23615
+ function skipOptionalWhitespace(header, index) {
23616
+ var cursor = index;
23617
+ while (header.charCodeAt(cursor) === 32 || header.charCodeAt(cursor) === 9) cursor++;
23618
+ return cursor;
23619
+ }
23620
+ }));
23621
+ //#endregion
23358
23622
  //#region ../../node_modules/accepts/node_modules/negotiator/lib/charset.js
23359
23623
  /**
23360
23624
  * negotiator
@@ -23364,6 +23628,7 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23364
23628
  * MIT Licensed
23365
23629
  */
23366
23630
  var require_charset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23631
+ var parseAccept = require_accept();
23367
23632
  /**
23368
23633
  * Module exports.
23369
23634
  * @public
@@ -23374,42 +23639,24 @@ var require_charset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23374
23639
  * Module variables.
23375
23640
  * @private
23376
23641
  */
23377
- var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
23378
- /**
23379
- * Parse the Accept-Charset header.
23380
- * @private
23381
- */
23382
23642
  function parseAcceptCharset(accept) {
23383
- var accepts = accept.split(",");
23643
+ var accepts = parseAccept(accept);
23384
23644
  for (var i = 0, j = 0; i < accepts.length; i++) {
23385
- var charset = parseCharset(accepts[i].trim(), i);
23645
+ var charset = formatCharset(accepts[i], i);
23386
23646
  if (charset) accepts[j++] = charset;
23387
23647
  }
23388
23648
  accepts.length = j;
23389
23649
  return accepts;
23390
23650
  }
23391
23651
  /**
23392
- * Parse a charset from the Accept-Charset header.
23652
+ * Format a parsed charset for negotiation.
23393
23653
  * @private
23394
23654
  */
23395
- function parseCharset(str, i) {
23396
- var match = simpleCharsetRegExp.exec(str);
23397
- if (!match) return null;
23398
- var charset = match[1];
23399
- var q = 1;
23400
- if (match[2]) {
23401
- var params = match[2].split(";");
23402
- for (var j = 0; j < params.length; j++) {
23403
- var p = params[j].trim().split("=");
23404
- if (p[0] === "q") {
23405
- q = parseFloat(p[1]);
23406
- break;
23407
- }
23408
- }
23409
- }
23655
+ function formatCharset(parsed, i) {
23656
+ if (!parsed.type) return null;
23410
23657
  return {
23411
- charset,
23412
- q,
23658
+ charset: parsed.type,
23659
+ q: parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1,
23413
23660
  i
23414
23661
  };
23415
23662
  }
@@ -23490,6 +23737,7 @@ var require_charset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23490
23737
  * MIT Licensed
23491
23738
  */
23492
23739
  var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23740
+ var parseAccept = require_accept();
23493
23741
  /**
23494
23742
  * Module exports.
23495
23743
  * @public
@@ -23500,17 +23748,12 @@ var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23500
23748
  * Module variables.
23501
23749
  * @private
23502
23750
  */
23503
- var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
23504
- /**
23505
- * Parse the Accept-Encoding header.
23506
- * @private
23507
- */
23508
23751
  function parseAcceptEncoding(accept) {
23509
- var accepts = accept.split(",");
23752
+ var accepts = parseAccept(accept);
23510
23753
  var hasIdentity = false;
23511
23754
  var minQuality = 1;
23512
23755
  for (var i = 0, j = 0; i < accepts.length; i++) {
23513
- var encoding = parseEncoding(accepts[i].trim(), i);
23756
+ var encoding = formatEncoding(accepts[i], i);
23514
23757
  if (encoding) {
23515
23758
  accepts[j++] = encoding;
23516
23759
  hasIdentity = hasIdentity || specify("identity", encoding);
@@ -23526,27 +23769,14 @@ var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23526
23769
  return accepts;
23527
23770
  }
23528
23771
  /**
23529
- * Parse an encoding from the Accept-Encoding header.
23772
+ * Format a parsed encoding for negotiation.
23530
23773
  * @private
23531
23774
  */
23532
- function parseEncoding(str, i) {
23533
- var match = simpleEncodingRegExp.exec(str);
23534
- if (!match) return null;
23535
- var encoding = match[1];
23536
- var q = 1;
23537
- if (match[2]) {
23538
- var params = match[2].split(";");
23539
- for (var j = 0; j < params.length; j++) {
23540
- var p = params[j].trim().split("=");
23541
- if (p[0] === "q") {
23542
- q = parseFloat(p[1]);
23543
- break;
23544
- }
23545
- }
23546
- }
23775
+ function formatEncoding(parsed, i) {
23776
+ if (!parsed.type) return null;
23547
23777
  return {
23548
- encoding,
23549
- q,
23778
+ encoding: parsed.type,
23779
+ q: parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1,
23550
23780
  i
23551
23781
  };
23552
23782
  }
@@ -23637,6 +23867,8 @@ var require_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23637
23867
  * MIT Licensed
23638
23868
  */
23639
23869
  var require_language = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23870
+ var contentType = require_dist();
23871
+ var parseAccept = require_accept();
23640
23872
  /**
23641
23873
  * Module exports.
23642
23874
  * @public
@@ -23647,45 +23879,28 @@ var require_language = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23647
23879
  * Module variables.
23648
23880
  * @private
23649
23881
  */
23650
- var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
23651
- /**
23652
- * Parse the Accept-Language header.
23653
- * @private
23654
- */
23655
23882
  function parseAcceptLanguage(accept) {
23656
- var accepts = accept.split(",");
23883
+ var accepts = parseAccept(accept);
23657
23884
  for (var i = 0, j = 0; i < accepts.length; i++) {
23658
- var language = parseLanguage(accepts[i].trim(), i);
23885
+ var language = formatLanguage(accepts[i], i);
23659
23886
  if (language) accepts[j++] = language;
23660
23887
  }
23661
23888
  accepts.length = j;
23662
23889
  return accepts;
23663
23890
  }
23664
23891
  /**
23665
- * Parse a language from the Accept-Language header.
23892
+ * Format a parsed language for negotiation.
23666
23893
  * @private
23667
23894
  */
23668
- function parseLanguage(str, i) {
23669
- var match = simpleLanguageRegExp.exec(str);
23670
- if (!match) return null;
23671
- var prefix = match[1];
23672
- var suffix = match[2];
23673
- var full = prefix;
23674
- if (suffix) full += "-" + suffix;
23675
- var q = 1;
23676
- if (match[3]) {
23677
- var params = match[3].split(";");
23678
- for (var j = 0; j < params.length; j++) {
23679
- var p = params[j].split("=");
23680
- if (p[0] === "q") q = parseFloat(p[1]);
23681
- }
23682
- }
23895
+ function formatLanguage(parsed, i) {
23896
+ if (!parsed.type) return null;
23897
+ var hyphen = parsed.type.indexOf("-");
23683
23898
  return {
23684
- prefix,
23685
- suffix,
23686
- q,
23899
+ prefix: hyphen === -1 ? parsed.type : parsed.type.slice(0, hyphen),
23900
+ suffix: hyphen === -1 ? void 0 : parsed.type.slice(hyphen + 1),
23901
+ q: parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1,
23687
23902
  i,
23688
- full
23903
+ full: parsed.type
23689
23904
  };
23690
23905
  }
23691
23906
  /**
@@ -23709,7 +23924,7 @@ var require_language = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23709
23924
  * @private
23710
23925
  */
23711
23926
  function specify(language, spec, index) {
23712
- var p = parseLanguage(language);
23927
+ var p = formatLanguage(contentType.parse(language), 0);
23713
23928
  if (!p) return null;
23714
23929
  var s = 0;
23715
23930
  if (spec.full.toLowerCase() === p.full.toLowerCase()) s |= 4;
@@ -23769,6 +23984,8 @@ var require_language = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23769
23984
  * MIT Licensed
23770
23985
  */
23771
23986
  var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23987
+ var contentType = require_dist();
23988
+ var parseAcceptHeader = require_accept();
23772
23989
  /**
23773
23990
  * Module exports.
23774
23991
  * @public
@@ -23779,49 +23996,28 @@ var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23779
23996
  * Module variables.
23780
23997
  * @private
23781
23998
  */
23782
- var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
23783
- /**
23784
- * Parse the Accept header.
23785
- * @private
23786
- */
23787
23999
  function parseAccept(accept) {
23788
- var accepts = splitMediaTypes(accept);
24000
+ var accepts = parseAcceptHeader(accept);
23789
24001
  for (var i = 0, j = 0; i < accepts.length; i++) {
23790
- var mediaType = parseMediaType(accepts[i].trim(), i);
24002
+ var mediaType = formatMediaType(accepts[i], i);
23791
24003
  if (mediaType) accepts[j++] = mediaType;
23792
24004
  }
23793
24005
  accepts.length = j;
23794
24006
  return accepts;
23795
24007
  }
23796
24008
  /**
23797
- * Parse a media type from the Accept header.
24009
+ * Format a parsed content type for negotiation.
23798
24010
  * @private
23799
24011
  */
23800
- function parseMediaType(str, i) {
23801
- var match = simpleMediaTypeRegExp.exec(str);
23802
- if (!match) return null;
23803
- var params = Object.create(null);
23804
- var q = 1;
23805
- var subtype = match[2];
23806
- var type = match[1];
23807
- if (match[3]) {
23808
- var kvps = splitParameters(match[3]).map(splitKeyValuePair);
23809
- for (var j = 0; j < kvps.length; j++) {
23810
- var pair = kvps[j];
23811
- var key = pair[0].toLowerCase();
23812
- var val = pair[1];
23813
- var value = val && val[0] === "\"" && val[val.length - 1] === "\"" ? val.slice(1, -1) : val;
23814
- if (key === "q") {
23815
- q = parseFloat(value);
23816
- break;
23817
- }
23818
- params[key] = value;
23819
- }
23820
- }
24012
+ function formatMediaType(parsed, i) {
24013
+ var slash = parsed.type.indexOf("/");
24014
+ if (slash === -1) return null;
24015
+ var q = parsed.parameters.q ? parseFloat(parsed.parameters.q) : 1;
24016
+ delete parsed.parameters.q;
23821
24017
  return {
23822
- type,
23823
- subtype,
23824
- params,
24018
+ type: parsed.type.slice(0, slash),
24019
+ subtype: parsed.type.slice(slash + 1),
24020
+ params: parsed.parameters,
23825
24021
  q,
23826
24022
  i
23827
24023
  };
@@ -23847,7 +24043,7 @@ var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23847
24043
  * @private
23848
24044
  */
23849
24045
  function specify(type, spec, index) {
23850
- var p = parseMediaType(type);
24046
+ var p = formatMediaType(contentType.parse(type), 0);
23851
24047
  var s = 0;
23852
24048
  if (!p) return null;
23853
24049
  if (spec.type.toLowerCase() == p.type.toLowerCase()) s |= 4;
@@ -23855,10 +24051,12 @@ var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23855
24051
  if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) s |= 2;
23856
24052
  else if (spec.subtype != "*") return null;
23857
24053
  var keys = Object.keys(spec.params);
23858
- if (keys.length > 0) if (keys.every(function(k) {
23859
- return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase();
23860
- })) s |= 1;
23861
- else return null;
24054
+ if (keys.length > 0) {
24055
+ if (keys.every(function(k) {
24056
+ return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase();
24057
+ })) s |= 1;
24058
+ else return null;
24059
+ }
23862
24060
  return {
23863
24061
  i: index,
23864
24062
  o: spec.i,
@@ -23901,57 +24099,6 @@ var require_mediaType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23901
24099
  function isQuality(spec) {
23902
24100
  return spec.q > 0;
23903
24101
  }
23904
- /**
23905
- * Count the number of quotes in a string.
23906
- * @private
23907
- */
23908
- function quoteCount(string) {
23909
- var count = 0;
23910
- var index = 0;
23911
- while ((index = string.indexOf("\"", index)) !== -1) {
23912
- count++;
23913
- index++;
23914
- }
23915
- return count;
23916
- }
23917
- /**
23918
- * Split a key value pair.
23919
- * @private
23920
- */
23921
- function splitKeyValuePair(str) {
23922
- var index = str.indexOf("=");
23923
- var key;
23924
- var val;
23925
- if (index === -1) key = str;
23926
- else {
23927
- key = str.slice(0, index);
23928
- val = str.slice(index + 1);
23929
- }
23930
- return [key, val];
23931
- }
23932
- /**
23933
- * Split an Accept header into media types.
23934
- * @private
23935
- */
23936
- function splitMediaTypes(accept) {
23937
- var accepts = accept.split(",");
23938
- for (var i = 1, j = 0; i < accepts.length; i++) if (quoteCount(accepts[j]) % 2 == 0) accepts[++j] = accepts[i];
23939
- else accepts[j] += "," + accepts[i];
23940
- accepts.length = j + 1;
23941
- return accepts;
23942
- }
23943
- /**
23944
- * Split a string of parameters.
23945
- * @private
23946
- */
23947
- function splitParameters(str) {
23948
- var parameters = str.split(";");
23949
- for (var i = 1, j = 0; i < parameters.length; i++) if (quoteCount(parameters[j]) % 2 == 0) parameters[++j] = parameters[i];
23950
- else parameters[j] += ";" + parameters[i];
23951
- parameters.length = j + 1;
23952
- for (var i = 0; i < parameters.length; i++) parameters[i] = parameters[i].trim();
23953
- return parameters;
23954
- }
23955
24102
  }));
23956
24103
  //#endregion
23957
24104
  //#region ../../node_modules/accepts/node_modules/negotiator/index.js
@@ -24271,9 +24418,7 @@ var require_fresh = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24271
24418
  list.push(str.substring(start, end));
24272
24419
  start = end = i + 1;
24273
24420
  break;
24274
- default:
24275
- end = i + 1;
24276
- break;
24421
+ default: end = i + 1;
24277
24422
  }
24278
24423
  list.push(str.substring(start, end));
24279
24424
  return list;
@@ -25467,7 +25612,7 @@ var require_send = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25467
25612
  * Maximum value allowed for the max age.
25468
25613
  * @private
25469
25614
  */
25470
- var MAX_MAXAGE = 3600 * 24 * 365 * 1e3;
25615
+ var MAX_MAXAGE = 31536e6;
25471
25616
  /**
25472
25617
  * Regular expression to match a path with a directory up component.
25473
25618
  * @private
@@ -25642,9 +25787,7 @@ var require_send = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25642
25787
  case "ENOTDIR":
25643
25788
  this.error(404, error);
25644
25789
  break;
25645
- default:
25646
- this.error(500, error);
25647
- break;
25790
+ default: this.error(500, error);
25648
25791
  }
25649
25792
  };
25650
25793
  /**
@@ -26082,9 +26225,7 @@ var require_send = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26082
26225
  if (start !== end) list.push(str.substring(start, end));
26083
26226
  start = end = i + 1;
26084
26227
  break;
26085
- default:
26086
- end = i + 1;
26087
- break;
26228
+ default: end = i + 1;
26088
26229
  }
26089
26230
  if (start !== end) list.push(str.substring(start, end));
26090
26231
  return list;
@@ -26173,9 +26314,7 @@ var require_vary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26173
26314
  list.push(header.substring(start, end));
26174
26315
  start = end = i + 1;
26175
26316
  break;
26176
- default:
26177
- end = i + 1;
26178
- break;
26317
+ default: end = i + 1;
26179
26318
  }
26180
26319
  list.push(header.substring(start, end));
26181
26320
  return list;
@@ -26307,12 +26446,10 @@ var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26307
26446
  break;
26308
26447
  case "boolean":
26309
26448
  case "number":
26310
- case "object":
26311
- if (chunk === null) chunk = "";
26312
- else if (ArrayBuffer.isView(chunk)) {
26313
- if (!this.get("Content-Type")) this.type("bin");
26314
- } else return this.json(chunk);
26315
- break;
26449
+ case "object": if (chunk === null) chunk = "";
26450
+ else if (ArrayBuffer.isView(chunk)) {
26451
+ if (!this.get("Content-Type")) this.type("bin");
26452
+ } else return this.json(chunk);
26316
26453
  }
26317
26454
  if (typeof chunk === "string") {
26318
26455
  encoding = "utf8";