@docbox-nz/hapi-gateway 0.3.0 → 0.3.1

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.
@@ -78,9 +78,10 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
78
78
  const assert = module.exports = function(condition, ...args) {
79
79
  if (condition) return;
80
80
  if (args.length === 1 && args[0] instanceof Error) throw args[0];
81
- throw new AssertError(args.filter((arg) => arg !== "").map((arg) => {
81
+ const msgs = args.filter((arg) => arg !== "").map((arg) => {
82
82
  return typeof arg === "string" ? arg : arg instanceof Error ? arg.message : Stringify(arg);
83
- }).join(" "), assert);
83
+ });
84
+ throw new AssertError(msgs.join(" "), assert);
84
85
  };
85
86
  }));
86
87
  //#endregion
@@ -138,7 +139,7 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports, module) => {
138
139
  weakMap: WeakMap.prototype,
139
140
  weakSet: WeakSet.prototype
140
141
  };
141
- internals.typeMap = new Map([
142
+ internals.typeMap = /* @__PURE__ */ new Map([
142
143
  ["[object Error]", exports.error],
143
144
  ["[object Map]", exports.map],
144
145
  ["[object Promise]", exports.promise],
@@ -171,7 +172,7 @@ var require_clone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
171
172
  const Types = require_types();
172
173
  const Utils = require_utils();
173
174
  const internals = {
174
- needsProtoHack: new Set([
175
+ needsProtoHack: /* @__PURE__ */ new Set([
175
176
  Types.set,
176
177
  Types.map,
177
178
  Types.weakSet,
@@ -315,8 +316,9 @@ var require_applyToDefaults = /* @__PURE__ */ __commonJSMin(((exports, module) =
315
316
  if (options.shallow) return internals.applyToDefaultsWithShallow(defaults, source, options);
316
317
  const copy = Clone(defaults);
317
318
  if (source === true) return copy;
319
+ const nullOverride = options.nullOverride !== void 0 ? options.nullOverride : false;
318
320
  return Merge(copy, source, {
319
- nullOverride: options.nullOverride !== void 0 ? options.nullOverride : false,
321
+ nullOverride,
320
322
  mergeArrays: false
321
323
  });
322
324
  };
@@ -334,8 +336,9 @@ var require_applyToDefaults = /* @__PURE__ */ __commonJSMin(((exports, module) =
334
336
  const copy = Clone(defaults, {}, seen);
335
337
  if (!merge) return copy;
336
338
  for (const key of merge) internals.reachCopy(copy, source, key);
339
+ const nullOverride = options.nullOverride !== void 0 ? options.nullOverride : false;
337
340
  return Merge(copy, source, {
338
- nullOverride: options.nullOverride !== void 0 ? options.nullOverride : false,
341
+ nullOverride,
339
342
  mergeArrays: false
340
343
  });
341
344
  };
@@ -696,7 +699,7 @@ var require_escapeHtml = /* @__PURE__ */ __commonJSMin(((exports, module) => {
696
699
  internals.isSafe = function(charCode) {
697
700
  return internals.safeCharCodes.has(charCode);
698
701
  };
699
- internals.namedHtml = new Map([
702
+ internals.namedHtml = /* @__PURE__ */ new Map([
700
703
  [38, "&"],
701
704
  [60, "<"],
702
705
  [62, ">"],
@@ -725,7 +728,7 @@ var require_escapeJson = /* @__PURE__ */ __commonJSMin(((exports, module) => {
725
728
  internals.escape = function(char) {
726
729
  return internals.replacements.get(char);
727
730
  };
728
- internals.replacements = new Map([
731
+ internals.replacements = /* @__PURE__ */ new Map([
729
732
  ["<", "\\u003c"],
730
733
  [">", "\\u003e"],
731
734
  ["&", "\\u0026"],
@@ -845,10 +848,10 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
845
848
  exports.wait = require_wait();
846
849
  }));
847
850
  //#endregion
848
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/bind.js
851
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/bind.js
849
852
  var import_lib = (/* @__PURE__ */ __commonJSMin(((exports) => {
850
853
  const Hoek = require_lib$1();
851
- const internals = { codes: new Map([
854
+ const internals = { codes: /* @__PURE__ */ new Map([
852
855
  [100, "Continue"],
853
856
  [101, "Switching Protocols"],
854
857
  [102, "Processing"],
@@ -1221,10 +1224,46 @@ function bind(fn, thisArg) {
1221
1224
  };
1222
1225
  }
1223
1226
  //#endregion
1224
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/utils.js
1227
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/utils.js
1225
1228
  const { toString } = Object.prototype;
1226
1229
  const { getPrototypeOf } = Object;
1227
1230
  const { iterator, toStringTag } = Symbol;
1231
+ const hasOwnProperty = (({ hasOwnProperty }) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
1232
+ /**
1233
+ * Walk the prototype chain (excluding the shared Object.prototype) looking for
1234
+ * an own `prop`. This distinguishes genuine own/inherited members — including
1235
+ * class accessors and template prototypes — from members injected via
1236
+ * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which
1237
+ * live on Object.prototype itself and are therefore never matched.
1238
+ *
1239
+ * @param {*} thing The value whose chain to inspect
1240
+ * @param {string|symbol} prop The property key to look for
1241
+ *
1242
+ * @returns {boolean} True when `prop` is owned below Object.prototype
1243
+ */
1244
+ const hasOwnInPrototypeChain = (thing, prop) => {
1245
+ let obj = thing;
1246
+ const seen = [];
1247
+ while (obj != null && obj !== Object.prototype) {
1248
+ if (seen.indexOf(obj) !== -1) return false;
1249
+ seen.push(obj);
1250
+ if (hasOwnProperty(obj, prop)) return true;
1251
+ obj = getPrototypeOf(obj);
1252
+ }
1253
+ return false;
1254
+ };
1255
+ /**
1256
+ * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
1257
+ * properties and members inherited from a non-Object.prototype source (a class
1258
+ * instance or template object) are honored; a value reachable only through a
1259
+ * polluted Object.prototype is ignored and `undefined` is returned.
1260
+ *
1261
+ * @param {*} obj The source object
1262
+ * @param {string|symbol} prop The property key to read
1263
+ *
1264
+ * @returns {*} The resolved value, or undefined when unsafe/absent
1265
+ */
1266
+ const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
1228
1267
  const kindOf = ((cache) => (thing) => {
1229
1268
  const str = toString.call(thing);
1230
1269
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -1327,9 +1366,9 @@ const isBoolean = (thing) => thing === true || thing === false;
1327
1366
  * @returns {boolean} True if value is a plain Object, otherwise false
1328
1367
  */
1329
1368
  const isPlainObject = (val) => {
1330
- if (kindOf(val) !== "object") return false;
1369
+ if (!isObject(val)) return false;
1331
1370
  const prototype = getPrototypeOf(val);
1332
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
1371
+ return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
1333
1372
  };
1334
1373
  /**
1335
1374
  * Determine if a value is an empty object (safely handles Buffers)
@@ -1539,14 +1578,24 @@ function merge(...objs) {
1539
1578
  const result = {};
1540
1579
  const assignValue = (val, key) => {
1541
1580
  if (key === "__proto__" || key === "constructor" || key === "prototype") return;
1542
- const targetKey = caseless && findKey(result, key) || key;
1581
+ const targetKey = caseless && typeof key === "string" && findKey(result, key) || key;
1543
1582
  const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
1544
1583
  if (isPlainObject(existing) && isPlainObject(val)) result[targetKey] = merge(existing, val);
1545
1584
  else if (isPlainObject(val)) result[targetKey] = merge({}, val);
1546
1585
  else if (isArray(val)) result[targetKey] = val.slice();
1547
1586
  else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val;
1548
1587
  };
1549
- for (let i = 0, l = objs.length; i < l; i++) objs[i] && forEach(objs[i], assignValue);
1588
+ for (let i = 0, l = objs.length; i < l; i++) {
1589
+ const source = objs[i];
1590
+ if (!source || isBuffer(source)) continue;
1591
+ forEach(source, assignValue);
1592
+ if (typeof source !== "object" || isArray(source)) continue;
1593
+ const symbols = Object.getOwnPropertySymbols(source);
1594
+ for (let j = 0; j < symbols.length; j++) {
1595
+ const symbol = symbols[j];
1596
+ if (propertyIsEnumerable.call(source, symbol)) assignValue(source[symbol], symbol);
1597
+ }
1598
+ }
1550
1599
  return result;
1551
1600
  }
1552
1601
  /**
@@ -1725,7 +1774,7 @@ const toCamelCase = (str) => {
1725
1774
  return p1.toUpperCase() + p2;
1726
1775
  });
1727
1776
  };
1728
- const hasOwnProperty = (({ hasOwnProperty }) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
1777
+ const { propertyIsEnumerable } = Object.prototype;
1729
1778
  /**
1730
1779
  * Determine if a value is a RegExp object
1731
1780
  *
@@ -1867,6 +1916,18 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
1867
1916
  */
1868
1917
  const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
1869
1918
  const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
1919
+ /**
1920
+ * Determine if a value is iterable via an iterator that is NOT sourced solely
1921
+ * from a polluted Object.prototype. Use this instead of `isIterable` whenever
1922
+ * the iterable comes from untrusted input (e.g. user-supplied header sources),
1923
+ * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
1924
+ * into an attacker-controlled entries iterator.
1925
+ *
1926
+ * @param {*} thing The value to test
1927
+ *
1928
+ * @returns {boolean} True if value has a non-polluted iterator
1929
+ */
1930
+ const isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
1870
1931
  var utils_default = {
1871
1932
  isArray,
1872
1933
  isArrayBuffer,
@@ -1911,6 +1972,8 @@ var utils_default = {
1911
1972
  isHTMLForm,
1912
1973
  hasOwnProperty,
1913
1974
  hasOwnProp: hasOwnProperty,
1975
+ hasOwnInPrototypeChain,
1976
+ getSafeProp,
1914
1977
  reduceDescriptors,
1915
1978
  freezeMethods,
1916
1979
  toObjectSet,
@@ -1926,10 +1989,11 @@ var utils_default = {
1926
1989
  isThenable,
1927
1990
  setImmediate: _setImmediate,
1928
1991
  asap,
1929
- isIterable
1992
+ isIterable,
1993
+ isSafeIterable
1930
1994
  };
1931
1995
  //#endregion
1932
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/parseHeaders.js
1996
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/parseHeaders.js
1933
1997
  const ignoreDuplicateOf = utils_default.toObjectSet([
1934
1998
  "age",
1935
1999
  "authorization",
@@ -1980,7 +2044,7 @@ var parseHeaders_default = (rawHeaders) => {
1980
2044
  return parsed;
1981
2045
  };
1982
2046
  //#endregion
1983
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/sanitizeHeaderValue.js
2047
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/sanitizeHeaderValue.js
1984
2048
  function trimSPorHTAB(str) {
1985
2049
  let start = 0;
1986
2050
  let end = str.length;
@@ -2012,7 +2076,7 @@ function toByteStringHeaderObject(headers) {
2012
2076
  return byteStringHeaders;
2013
2077
  }
2014
2078
  //#endregion
2015
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/AxiosHeaders.js
2079
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/AxiosHeaders.js
2016
2080
  const $internals = Symbol("internals");
2017
2081
  function normalizeHeader(header) {
2018
2082
  return header && String(header).trim().toLowerCase();
@@ -2065,18 +2129,22 @@ var AxiosHeaders$1 = class {
2065
2129
  const self = this;
2066
2130
  function setHeader(_value, _header, _rewrite) {
2067
2131
  const lHeader = normalizeHeader(_header);
2068
- if (!lHeader) throw new Error("header name must be a non-empty string");
2132
+ if (!lHeader) return;
2069
2133
  const key = utils_default.findKey(self, lHeader);
2070
2134
  if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value);
2071
2135
  }
2072
2136
  const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
2073
2137
  if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite);
2074
2138
  else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite);
2075
- else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
2076
- let obj = {}, dest, key;
2139
+ else if (utils_default.isObject(header) && utils_default.isSafeIterable(header)) {
2140
+ let obj = Object.create(null), dest, key;
2077
2141
  for (const entry of header) {
2078
- if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair");
2079
- obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
2142
+ if (!utils_default.isArray(entry)) throw new TypeError("Object iterator must return a key-value pair");
2143
+ key = entry[0];
2144
+ if (utils_default.hasOwnProp(obj, key)) {
2145
+ dest = obj[key];
2146
+ obj[key] = utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
2147
+ } else obj[key] = entry[1];
2080
2148
  }
2081
2149
  setHeaders(obj, valueOrRewrite);
2082
2150
  } else header != null && setHeader(valueOrRewrite, header, rewrite);
@@ -2214,7 +2282,7 @@ utils_default.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
2214
2282
  });
2215
2283
  utils_default.freezeMethods(AxiosHeaders$1);
2216
2284
  //#endregion
2217
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/AxiosError.js
2285
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/AxiosError.js
2218
2286
  const REDACTED = "[REDACTED ****]";
2219
2287
  function hasOwnOrPrototypeToJSON(source) {
2220
2288
  if (utils_default.hasOwnProp(source, "toJSON")) return true;
@@ -2260,7 +2328,13 @@ function redactConfig(config, redactKeys) {
2260
2328
  var AxiosError$1 = class AxiosError$1 extends Error {
2261
2329
  static from(error, code, config, request, response, customProps) {
2262
2330
  const axiosError = new AxiosError$1(error.message, code || error.code, config, request, response);
2263
- axiosError.cause = error;
2331
+ Object.defineProperty(axiosError, "cause", {
2332
+ __proto__: null,
2333
+ value: error,
2334
+ writable: true,
2335
+ enumerable: false,
2336
+ configurable: true
2337
+ });
2264
2338
  axiosError.name = error.name;
2265
2339
  if (error.status != null && axiosError.status == null) axiosError.status = error.status;
2266
2340
  customProps && Object.assign(axiosError, customProps);
@@ -2333,7 +2407,7 @@ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
2333
2407
  //#region node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js
2334
2408
  var require_delayed_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2335
2409
  var Stream$2 = require("stream").Stream;
2336
- var util$6 = require("util");
2410
+ var util$7 = require("util");
2337
2411
  module.exports = DelayedStream;
2338
2412
  function DelayedStream() {
2339
2413
  this.source = null;
@@ -2344,7 +2418,7 @@ var require_delayed_stream = /* @__PURE__ */ __commonJSMin(((exports, module) =>
2344
2418
  this._released = false;
2345
2419
  this._bufferedEvents = [];
2346
2420
  }
2347
- util$6.inherits(DelayedStream, Stream$2);
2421
+ util$7.inherits(DelayedStream, Stream$2);
2348
2422
  DelayedStream.create = function(source, options) {
2349
2423
  var delayedStream = new this();
2350
2424
  options = options || {};
@@ -2410,7 +2484,7 @@ var require_delayed_stream = /* @__PURE__ */ __commonJSMin(((exports, module) =>
2410
2484
  //#endregion
2411
2485
  //#region node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js
2412
2486
  var require_combined_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2413
- var util$5 = require("util");
2487
+ var util$6 = require("util");
2414
2488
  var Stream$1 = require("stream").Stream;
2415
2489
  var DelayedStream = require_delayed_stream();
2416
2490
  module.exports = CombinedStream;
@@ -2426,30 +2500,30 @@ var require_combined_stream = /* @__PURE__ */ __commonJSMin(((exports, module) =
2426
2500
  this._insideLoop = false;
2427
2501
  this._pendingNext = false;
2428
2502
  }
2429
- util$5.inherits(CombinedStream, Stream$1);
2503
+ util$6.inherits(CombinedStream, Stream$1);
2430
2504
  CombinedStream.create = function(options) {
2431
2505
  var combinedStream = new this();
2432
2506
  options = options || {};
2433
2507
  for (var option in options) combinedStream[option] = options[option];
2434
2508
  return combinedStream;
2435
2509
  };
2436
- CombinedStream.isStreamLike = function(stream$6) {
2437
- return typeof stream$6 !== "function" && typeof stream$6 !== "string" && typeof stream$6 !== "boolean" && typeof stream$6 !== "number" && !Buffer.isBuffer(stream$6);
2510
+ CombinedStream.isStreamLike = function(stream$5) {
2511
+ return typeof stream$5 !== "function" && typeof stream$5 !== "string" && typeof stream$5 !== "boolean" && typeof stream$5 !== "number" && !Buffer.isBuffer(stream$5);
2438
2512
  };
2439
- CombinedStream.prototype.append = function(stream$7) {
2440
- if (CombinedStream.isStreamLike(stream$7)) {
2441
- if (!(stream$7 instanceof DelayedStream)) {
2442
- var newStream = DelayedStream.create(stream$7, {
2513
+ CombinedStream.prototype.append = function(stream$6) {
2514
+ if (CombinedStream.isStreamLike(stream$6)) {
2515
+ if (!(stream$6 instanceof DelayedStream)) {
2516
+ var newStream = DelayedStream.create(stream$6, {
2443
2517
  maxDataSize: Infinity,
2444
2518
  pauseStream: this.pauseStreams
2445
2519
  });
2446
- stream$7.on("data", this._checkDataSize.bind(this));
2447
- stream$7 = newStream;
2520
+ stream$6.on("data", this._checkDataSize.bind(this));
2521
+ stream$6 = newStream;
2448
2522
  }
2449
- this._handleErrors(stream$7);
2450
- if (this.pauseStreams) stream$7.pause();
2523
+ this._handleErrors(stream$6);
2524
+ if (this.pauseStreams) stream$6.pause();
2451
2525
  }
2452
- this._streams.push(stream$7);
2526
+ this._streams.push(stream$6);
2453
2527
  return this;
2454
2528
  };
2455
2529
  CombinedStream.prototype.pipe = function(dest, options) {
@@ -2474,37 +2548,37 @@ var require_combined_stream = /* @__PURE__ */ __commonJSMin(((exports, module) =
2474
2548
  }
2475
2549
  };
2476
2550
  CombinedStream.prototype._realGetNext = function() {
2477
- var stream$8 = this._streams.shift();
2478
- if (typeof stream$8 == "undefined") {
2551
+ var stream$7 = this._streams.shift();
2552
+ if (typeof stream$7 == "undefined") {
2479
2553
  this.end();
2480
2554
  return;
2481
2555
  }
2482
- if (typeof stream$8 !== "function") {
2483
- this._pipeNext(stream$8);
2556
+ if (typeof stream$7 !== "function") {
2557
+ this._pipeNext(stream$7);
2484
2558
  return;
2485
2559
  }
2486
- stream$8(function(stream$9) {
2487
- if (CombinedStream.isStreamLike(stream$9)) {
2488
- stream$9.on("data", this._checkDataSize.bind(this));
2489
- this._handleErrors(stream$9);
2560
+ stream$7(function(stream$8) {
2561
+ if (CombinedStream.isStreamLike(stream$8)) {
2562
+ stream$8.on("data", this._checkDataSize.bind(this));
2563
+ this._handleErrors(stream$8);
2490
2564
  }
2491
- this._pipeNext(stream$9);
2565
+ this._pipeNext(stream$8);
2492
2566
  }.bind(this));
2493
2567
  };
2494
- CombinedStream.prototype._pipeNext = function(stream$10) {
2495
- this._currentStream = stream$10;
2496
- if (CombinedStream.isStreamLike(stream$10)) {
2497
- stream$10.on("end", this._getNext.bind(this));
2498
- stream$10.pipe(this, { end: false });
2568
+ CombinedStream.prototype._pipeNext = function(stream$9) {
2569
+ this._currentStream = stream$9;
2570
+ if (CombinedStream.isStreamLike(stream$9)) {
2571
+ stream$9.on("end", this._getNext.bind(this));
2572
+ stream$9.pipe(this, { end: false });
2499
2573
  return;
2500
2574
  }
2501
- var value = stream$10;
2575
+ var value = stream$9;
2502
2576
  this.write(value);
2503
2577
  this._getNext();
2504
2578
  };
2505
- CombinedStream.prototype._handleErrors = function(stream$11) {
2579
+ CombinedStream.prototype._handleErrors = function(stream$10) {
2506
2580
  var self = this;
2507
- stream$11.on("error", function(err) {
2581
+ stream$10.on("error", function(err) {
2508
2582
  self._emitError(err);
2509
2583
  });
2510
2584
  };
@@ -2547,9 +2621,9 @@ var require_combined_stream = /* @__PURE__ */ __commonJSMin(((exports, module) =
2547
2621
  CombinedStream.prototype._updateDataSize = function() {
2548
2622
  this.dataSize = 0;
2549
2623
  var self = this;
2550
- this._streams.forEach(function(stream$12) {
2551
- if (!stream$12.dataSize) return;
2552
- self.dataSize += stream$12.dataSize;
2624
+ this._streams.forEach(function(stream$11) {
2625
+ if (!stream$11.dataSize) return;
2626
+ self.dataSize += stream$11.dataSize;
2553
2627
  });
2554
2628
  if (this._currentStream && this._currentStream.dataSize) this.dataSize += this._currentStream.dataSize;
2555
2629
  };
@@ -9991,7 +10065,7 @@ var require_asynckit = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9991
10065
  };
9992
10066
  }));
9993
10067
  //#endregion
9994
- //#region node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js
10068
+ //#region node_modules/.pnpm/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.js
9995
10069
  var require_es_object_atoms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9996
10070
  /** @type {import('.')} */
9997
10071
  module.exports = Object;
@@ -10311,7 +10385,7 @@ var require_get_proto = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10311
10385
  } : null;
10312
10386
  }));
10313
10387
  //#endregion
10314
- //#region node_modules/.pnpm/hasown@2.0.3/node_modules/hasown/index.js
10388
+ //#region node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js
10315
10389
  var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10316
10390
  var call = Function.prototype.call;
10317
10391
  var $hasOwn = Object.prototype.hasOwnProperty;
@@ -10676,7 +10750,7 @@ var require_es_set_tostringtag = /* @__PURE__ */ __commonJSMin(((exports, module
10676
10750
  };
10677
10751
  }));
10678
10752
  //#endregion
10679
- //#region node_modules/.pnpm/form-data@4.0.5/node_modules/form-data/lib/populate.js
10753
+ //#region node_modules/.pnpm/form-data@4.0.6/node_modules/form-data/lib/populate.js
10680
10754
  var require_populate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10681
10755
  module.exports = function(dst, src) {
10682
10756
  Object.keys(src).forEach(function(prop) {
@@ -10687,7 +10761,7 @@ var require_populate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10687
10761
  }));
10688
10762
  var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
10689
10763
  var CombinedStream = require_combined_stream();
10690
- var util$4 = require("util");
10764
+ var util$5 = require("util");
10691
10765
  var path$1 = require("path");
10692
10766
  var http$3 = require("http");
10693
10767
  var https$3 = require("https");
@@ -10701,6 +10775,17 @@ var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
10701
10775
  var hasOwn = require_hasown();
10702
10776
  var populate = require_populate();
10703
10777
  /**
10778
+ * Escape CR, LF, and `"` in a multipart `name`/`filename` parameter, so a field
10779
+ * name or filename can not break out of its header line to inject headers or
10780
+ * smuggle additional parts. Matches the WHATWG HTML multipart/form-data encoding.
10781
+ *
10782
+ * @param {string} str - the parameter value to escape
10783
+ * @returns {string} the escaped value
10784
+ */
10785
+ function escapeHeaderParam(str) {
10786
+ return String(str).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22");
10787
+ }
10788
+ /**
10704
10789
  * Create readable "multipart/form-data" streams.
10705
10790
  * Can be used to submit forms
10706
10791
  * and file uploads to other web applications.
@@ -10717,7 +10802,7 @@ var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
10717
10802
  options = options || {};
10718
10803
  for (var option in options) this[option] = options[option];
10719
10804
  }
10720
- util$4.inherits(FormData, CombinedStream);
10805
+ util$5.inherits(FormData, CombinedStream);
10721
10806
  FormData.LINE_BREAK = "\r\n";
10722
10807
  FormData.DEFAULT_CONTENT_TYPE = "application/octet-stream";
10723
10808
  FormData.prototype.append = function(field, value, options) {
@@ -10770,7 +10855,7 @@ var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
10770
10855
  var contentType = this._getContentType(value, options);
10771
10856
  var contents = "";
10772
10857
  var headers = {
10773
- "Content-Disposition": ["form-data", "name=\"" + field + "\""].concat(contentDisposition || []),
10858
+ "Content-Disposition": ["form-data", "name=\"" + escapeHeaderParam(field) + "\""].concat(contentDisposition || []),
10774
10859
  "Content-Type": [].concat(contentType || [])
10775
10860
  };
10776
10861
  if (typeof options.header === "object") populate(headers, options.header);
@@ -10788,7 +10873,7 @@ var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
10788
10873
  if (typeof options.filepath === "string") filename = path$1.normalize(options.filepath).replace(/\\/g, "/");
10789
10874
  else if (options.filename || value && (value.name || value.path)) filename = path$1.basename(options.filename || value && (value.name || value.path));
10790
10875
  else if (value && value.readable && hasOwn(value, "httpVersion")) filename = path$1.basename(value.client._httpMessage.path || "");
10791
- if (filename) return "filename=\"" + filename + "\"";
10876
+ if (filename) return "filename=\"" + escapeHeaderParam(filename) + "\"";
10792
10877
  };
10793
10878
  FormData.prototype._getContentType = function(value, options) {
10794
10879
  var contentType = options.contentType;
@@ -10918,8 +11003,6 @@ var FormData_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
10918
11003
  setToStringTag(FormData.prototype, "FormData");
10919
11004
  module.exports = FormData;
10920
11005
  })))(), 1)).default;
10921
- //#endregion
10922
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/toFormData.js
10923
11006
  /**
10924
11007
  * Determines if the given thing is a array or js object.
10925
11008
  *
@@ -11008,15 +11091,34 @@ function toFormData$1(obj, formData, options) {
11008
11091
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
11009
11092
  const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
11010
11093
  const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
11094
+ const stack = [];
11011
11095
  if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function");
11012
11096
  function convertValue(value) {
11013
11097
  if (value === null) return "";
11014
11098
  if (utils_default.isDate(value)) return value.toISOString();
11015
11099
  if (utils_default.isBoolean(value)) return value.toString();
11016
11100
  if (!useBlob && utils_default.isBlob(value)) throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
11017
- if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
11101
+ if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
11102
+ if (useBlob && typeof _Blob === "function") return new _Blob([value]);
11103
+ if (typeof Buffer !== "undefined") return Buffer.from(value);
11104
+ throw new AxiosError$1("Blob is not supported. Use a Buffer instead.", AxiosError$1.ERR_NOT_SUPPORT);
11105
+ }
11018
11106
  return value;
11019
11107
  }
11108
+ function throwIfMaxDepthExceeded(depth) {
11109
+ if (depth > maxDepth) throw new AxiosError$1("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED);
11110
+ }
11111
+ function stringifyWithDepthLimit(value, depth) {
11112
+ if (maxDepth === Infinity) return JSON.stringify(value);
11113
+ const ancestors = [];
11114
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
11115
+ if (!utils_default.isObject(currentValue)) return currentValue;
11116
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) ancestors.pop();
11117
+ ancestors.push(currentValue);
11118
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
11119
+ return currentValue;
11120
+ });
11121
+ }
11020
11122
  /**
11021
11123
  * Default visitor.
11022
11124
  *
@@ -11036,7 +11138,7 @@ function toFormData$1(obj, formData, options) {
11036
11138
  if (value && !path && typeof value === "object") {
11037
11139
  if (utils_default.endsWith(key, "{}")) {
11038
11140
  key = metaTokens ? key : key.slice(0, -2);
11039
- value = JSON.stringify(value);
11141
+ value = stringifyWithDepthLimit(value, 1);
11040
11142
  } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
11041
11143
  key = removeBrackets(key);
11042
11144
  arr.forEach(function each(el, index) {
@@ -11049,7 +11151,6 @@ function toFormData$1(obj, formData, options) {
11049
11151
  formData.append(renderKey(path, key, dots), convertValue(value));
11050
11152
  return false;
11051
11153
  }
11052
- const stack = [];
11053
11154
  const exposedHelpers = Object.assign(predicates, {
11054
11155
  defaultVisitor,
11055
11156
  convertValue,
@@ -11057,8 +11158,8 @@ function toFormData$1(obj, formData, options) {
11057
11158
  });
11058
11159
  function build(value, path, depth = 0) {
11059
11160
  if (utils_default.isUndefined(value)) return;
11060
- if (depth > maxDepth) throw new AxiosError$1("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED);
11061
- if (stack.indexOf(value) !== -1) throw Error("Circular reference detected in " + path.join("."));
11161
+ throwIfMaxDepthExceeded(depth);
11162
+ if (stack.indexOf(value) !== -1) throw new Error("Circular reference detected in " + path.join("."));
11062
11163
  stack.push(value);
11063
11164
  utils_default.forEach(value, function each(el, key) {
11064
11165
  if ((!(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers)) === true) build(el, path ? path.concat(key) : [key], depth + 1);
@@ -11070,7 +11171,7 @@ function toFormData$1(obj, formData, options) {
11070
11171
  return formData;
11071
11172
  }
11072
11173
  //#endregion
11073
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
11174
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
11074
11175
  /**
11075
11176
  * It encodes a string by replacing all characters that are not in the unreserved set with
11076
11177
  * their percent-encoded equivalents
@@ -11109,15 +11210,13 @@ prototype.append = function append(name, value) {
11109
11210
  this._pairs.push([name, value]);
11110
11211
  };
11111
11212
  prototype.toString = function toString(encoder) {
11112
- const _encode = encoder ? function(value) {
11113
- return encoder.call(this, value, encode$1);
11114
- } : encode$1;
11213
+ const _encode = encoder ? (value) => encoder.call(this, value, encode$1) : encode$1;
11115
11214
  return this._pairs.map(function each(pair) {
11116
11215
  return _encode(pair[0]) + "=" + _encode(pair[1]);
11117
11216
  }, "").join("&");
11118
11217
  };
11119
11218
  //#endregion
11120
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/buildURL.js
11219
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/buildURL.js
11121
11220
  /**
11122
11221
  * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
11123
11222
  * their plain counterparts (`:`, `$`, `,`, `+`).
@@ -11140,9 +11239,10 @@ function encode(val) {
11140
11239
  */
11141
11240
  function buildURL(url, params, options) {
11142
11241
  if (!params) return url;
11143
- const _encode = options && options.encode || encode;
11242
+ url = url || "";
11144
11243
  const _options = utils_default.isFunction(options) ? { serialize: options } : options;
11145
- const serializeFn = _options && _options.serialize;
11244
+ const _encode = utils_default.getSafeProp(_options, "encode") || encode;
11245
+ const serializeFn = utils_default.getSafeProp(_options, "serialize");
11146
11246
  let serializedParams;
11147
11247
  if (serializeFn) serializedParams = serializeFn(params, _options);
11148
11248
  else serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
@@ -11154,7 +11254,7 @@ function buildURL(url, params, options) {
11154
11254
  return url;
11155
11255
  }
11156
11256
  //#endregion
11157
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/InterceptorManager.js
11257
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/InterceptorManager.js
11158
11258
  var InterceptorManager = class {
11159
11259
  constructor() {
11160
11260
  this.handlers = [];
@@ -11212,18 +11312,20 @@ var InterceptorManager = class {
11212
11312
  }
11213
11313
  };
11214
11314
  //#endregion
11215
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/defaults/transitional.js
11315
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/defaults/transitional.js
11216
11316
  var transitional_default = {
11217
11317
  silentJSONParsing: true,
11218
11318
  forcedJSONParsing: true,
11219
11319
  clarifyTimeoutError: false,
11220
- legacyInterceptorReqResOrdering: true
11320
+ legacyInterceptorReqResOrdering: true,
11321
+ advertiseZstdAcceptEncoding: false,
11322
+ validateStatusUndefinedResolves: true
11221
11323
  };
11222
11324
  //#endregion
11223
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
11325
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
11224
11326
  var URLSearchParams_default = url.default.URLSearchParams;
11225
11327
  //#endregion
11226
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/platform/node/index.js
11328
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/platform/node/index.js
11227
11329
  const ALPHA = "abcdefghijklmnopqrstuvwxyz";
11228
11330
  const DIGIT = "0123456789";
11229
11331
  const ALPHABET = {
@@ -11256,7 +11358,7 @@ var node_default = {
11256
11358
  ]
11257
11359
  };
11258
11360
  //#endregion
11259
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/platform/common/utils.js
11361
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/platform/common/utils.js
11260
11362
  var utils_exports = /* @__PURE__ */ __exportAll({
11261
11363
  hasBrowserEnv: () => hasBrowserEnv,
11262
11364
  hasStandardBrowserEnv: () => hasStandardBrowserEnv,
@@ -11297,16 +11399,18 @@ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [
11297
11399
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
11298
11400
  * This leads to a problem when axios post `FormData` in webWorker
11299
11401
  */
11300
- const hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
11402
+ const hasStandardBrowserWebWorkerEnv = (() => {
11403
+ return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
11404
+ })();
11301
11405
  const origin = hasBrowserEnv && window.location.href || "http://localhost";
11302
11406
  //#endregion
11303
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/platform/index.js
11407
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/platform/index.js
11304
11408
  var platform_default = {
11305
11409
  ...utils_exports,
11306
11410
  ...node_default
11307
11411
  };
11308
11412
  //#endregion
11309
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/toURLEncodedForm.js
11413
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/toURLEncodedForm.js
11310
11414
  function toURLEncodedForm(data, options) {
11311
11415
  return toFormData$1(data, new platform_default.classes.URLSearchParams(), {
11312
11416
  visitor: function(value, key, path, helpers) {
@@ -11320,7 +11424,11 @@ function toURLEncodedForm(data, options) {
11320
11424
  });
11321
11425
  }
11322
11426
  //#endregion
11323
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/formDataToJSON.js
11427
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/formDataToJSON.js
11428
+ const MAX_DEPTH = 100;
11429
+ function throwIfDepthExceeded(index) {
11430
+ if (index > MAX_DEPTH) throw new AxiosError$1("FormData field is too deeply nested (" + index + " levels). Max depth: 100", AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED);
11431
+ }
11324
11432
  /**
11325
11433
  * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
11326
11434
  *
@@ -11329,9 +11437,14 @@ function toURLEncodedForm(data, options) {
11329
11437
  * @returns An array of strings.
11330
11438
  */
11331
11439
  function parsePropPath(name) {
11332
- return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
11333
- return match[0] === "[]" ? "" : match[1] || match[0];
11334
- });
11440
+ const path = [];
11441
+ const pattern = /\w+|\[(\w*)]/g;
11442
+ let match;
11443
+ while ((match = pattern.exec(name)) !== null) {
11444
+ throwIfDepthExceeded(path.length);
11445
+ path.push(match[0] === "[]" ? "" : match[1] || match[0]);
11446
+ }
11447
+ return path;
11335
11448
  }
11336
11449
  /**
11337
11450
  * Convert an array to an object.
@@ -11361,6 +11474,7 @@ function arrayToObject(arr) {
11361
11474
  */
11362
11475
  function formDataToJSON(formData) {
11363
11476
  function buildPath(path, value, target, index) {
11477
+ throwIfDepthExceeded(index);
11364
11478
  let name = path[index++];
11365
11479
  if (name === "__proto__") return true;
11366
11480
  const isNumericKey = Number.isFinite(+name);
@@ -11385,7 +11499,7 @@ function formDataToJSON(formData) {
11385
11499
  return null;
11386
11500
  }
11387
11501
  //#endregion
11388
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/defaults/index.js
11502
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/defaults/index.js
11389
11503
  const own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0;
11390
11504
  /**
11391
11505
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
@@ -11493,7 +11607,7 @@ utils_default.forEach([
11493
11607
  defaults.headers[method] = {};
11494
11608
  });
11495
11609
  //#endregion
11496
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/transformData.js
11610
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/transformData.js
11497
11611
  /**
11498
11612
  * Transform the data for a request or a response
11499
11613
  *
@@ -11514,12 +11628,12 @@ function transformData(fns, response) {
11514
11628
  return data;
11515
11629
  }
11516
11630
  //#endregion
11517
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/cancel/isCancel.js
11631
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/cancel/isCancel.js
11518
11632
  function isCancel$1(value) {
11519
11633
  return !!(value && value.__CANCEL__);
11520
11634
  }
11521
11635
  //#endregion
11522
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/cancel/CanceledError.js
11636
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/cancel/CanceledError.js
11523
11637
  var CanceledError$1 = class extends AxiosError$1 {
11524
11638
  /**
11525
11639
  * A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -11537,7 +11651,7 @@ var CanceledError$1 = class extends AxiosError$1 {
11537
11651
  }
11538
11652
  };
11539
11653
  //#endregion
11540
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/settle.js
11654
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/settle.js
11541
11655
  /**
11542
11656
  * Resolve or reject a Promise based on response status.
11543
11657
  *
@@ -11553,7 +11667,7 @@ function settle(resolve, reject, response) {
11553
11667
  else reject(new AxiosError$1("Request failed with status code " + response.status, response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE, response.config, response.request, response));
11554
11668
  }
11555
11669
  //#endregion
11556
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/isAbsoluteURL.js
11670
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/isAbsoluteURL.js
11557
11671
  /**
11558
11672
  * Determines whether the specified URL is absolute
11559
11673
  *
@@ -11566,7 +11680,7 @@ function isAbsoluteURL(url) {
11566
11680
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
11567
11681
  }
11568
11682
  //#endregion
11569
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/combineURLs.js
11683
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/combineURLs.js
11570
11684
  /**
11571
11685
  * Creates a new URL by combining the specified URLs
11572
11686
  *
@@ -11579,7 +11693,20 @@ function combineURLs(baseURL, relativeURL) {
11579
11693
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
11580
11694
  }
11581
11695
  //#endregion
11582
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/buildFullPath.js
11696
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/buildFullPath.js
11697
+ const malformedHttpProtocol = /^https?:(?!\/\/)/i;
11698
+ const httpProtocolControlCharacters = /[\t\n\r]/g;
11699
+ function stripLeadingC0ControlOrSpace(url) {
11700
+ let i = 0;
11701
+ while (i < url.length && url.charCodeAt(i) <= 32) i++;
11702
+ return url.slice(i);
11703
+ }
11704
+ function normalizeURLForProtocolCheck(url) {
11705
+ return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, "");
11706
+ }
11707
+ function assertValidHttpProtocolURL(url, config) {
11708
+ if (typeof url === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) throw new AxiosError$1("Invalid URL: missing \"//\" after protocol", AxiosError$1.ERR_INVALID_URL, config);
11709
+ }
11583
11710
  /**
11584
11711
  * Creates a new URL by combining the baseURL with the requestedURL,
11585
11712
  * only when the requestedURL is not already an absolute URL.
@@ -11590,9 +11717,13 @@ function combineURLs(baseURL, relativeURL) {
11590
11717
  *
11591
11718
  * @returns {string} The combined full path
11592
11719
  */
11593
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
11720
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
11721
+ assertValidHttpProtocolURL(requestedURL, config);
11594
11722
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
11595
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) return combineURLs(baseURL, requestedURL);
11723
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
11724
+ assertValidHttpProtocolURL(baseURL, config);
11725
+ return combineURLs(baseURL, requestedURL);
11726
+ }
11596
11727
  return requestedURL;
11597
11728
  }
11598
11729
  //#endregion
@@ -12188,7 +12319,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12188
12319
  * Module dependencies.
12189
12320
  */
12190
12321
  const tty = require("tty");
12191
- const util$3 = require("util");
12322
+ const util$4 = require("util");
12192
12323
  /**
12193
12324
  * This is the Node.js implementation of `debug()`.
12194
12325
  */
@@ -12198,7 +12329,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12198
12329
  exports.save = save;
12199
12330
  exports.load = load;
12200
12331
  exports.useColors = useColors;
12201
- exports.destroy = util$3.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
12332
+ exports.destroy = util$4.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
12202
12333
  /**
12203
12334
  * Colors.
12204
12335
  */
@@ -12339,7 +12470,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12339
12470
  * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
12340
12471
  */
12341
12472
  function log(...args) {
12342
- return process.stderr.write(util$3.formatWithOptions(exports.inspectOpts, ...args) + "\n");
12473
+ return process.stderr.write(util$4.formatWithOptions(exports.inspectOpts, ...args) + "\n");
12343
12474
  }
12344
12475
  /**
12345
12476
  * Save `namespaces`.
@@ -12378,14 +12509,14 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12378
12509
  */
12379
12510
  formatters.o = function(v) {
12380
12511
  this.inspectOpts.colors = this.useColors;
12381
- return util$3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
12512
+ return util$4.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
12382
12513
  };
12383
12514
  /**
12384
12515
  * Map %O to `util.inspect()`, allowing multiple lines if needed.
12385
12516
  */
12386
12517
  formatters.O = function(v) {
12387
12518
  this.inspectOpts.colors = this.useColors;
12388
- return util$3.inspect(v, this.inspectOpts);
12519
+ return util$4.inspect(v, this.inspectOpts);
12389
12520
  };
12390
12521
  }));
12391
12522
  //#endregion
@@ -12537,7 +12668,8 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12537
12668
  req.onSocket(socket);
12538
12669
  return;
12539
12670
  }
12540
- onerror(/* @__PURE__ */ new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``));
12671
+ const err = /* @__PURE__ */ new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
12672
+ onerror(err);
12541
12673
  };
12542
12674
  if (typeof this.callback !== "function") {
12543
12675
  onerror(/* @__PURE__ */ new Error("`callback` is not defined"));
@@ -13249,18 +13381,18 @@ var require_follow_redirects = /* @__PURE__ */ __commonJSMin(((exports, module)
13249
13381
  module.exports.wrap = wrap;
13250
13382
  }));
13251
13383
  //#endregion
13252
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/env/data.js
13384
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/env/data.js
13253
13385
  var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
13254
13386
  var import_follow_redirects = /* @__PURE__ */ __toESM(require_follow_redirects(), 1);
13255
- const VERSION$1 = "1.16.1";
13387
+ const VERSION$1 = "1.18.1";
13256
13388
  //#endregion
13257
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/parseProtocol.js
13389
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/parseProtocol.js
13258
13390
  function parseProtocol(url) {
13259
13391
  const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
13260
13392
  return match && match[1] || "";
13261
13393
  }
13262
13394
  //#endregion
13263
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/fromDataURI.js
13395
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/fromDataURI.js
13264
13396
  const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
13265
13397
  /**
13266
13398
  * Parse data uri to a Buffer or Blob
@@ -13284,10 +13416,10 @@ function fromDataURI(uri, asBlob, options) {
13284
13416
  const params = match[2];
13285
13417
  const encoding = match[3] ? "base64" : "utf8";
13286
13418
  const body = match[4];
13287
- let mime;
13419
+ let mime = "";
13288
13420
  if (type) mime = params ? type + params : type;
13289
13421
  else if (params) mime = "text/plain" + params;
13290
- const buffer = Buffer.from(decodeURIComponent(body), encoding);
13422
+ const buffer = encoding === "base64" ? Buffer.from(body, "base64") : Buffer.from(decodeURIComponent(body), encoding);
13291
13423
  if (asBlob) {
13292
13424
  if (!_Blob) throw new AxiosError$1("Blob is not supported", AxiosError$1.ERR_NOT_SUPPORT);
13293
13425
  return new _Blob([buffer], { type: mime });
@@ -13297,7 +13429,7 @@ function fromDataURI(uri, asBlob, options) {
13297
13429
  throw new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_NOT_SUPPORT);
13298
13430
  }
13299
13431
  //#endregion
13300
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/AxiosTransformStream.js
13432
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/AxiosTransformStream.js
13301
13433
  const kInternals = Symbol("internals");
13302
13434
  var AxiosTransformStream = class extends stream.default.Transform {
13303
13435
  constructor(options) {
@@ -13391,7 +13523,7 @@ var AxiosTransformStream = class extends stream.default.Transform {
13391
13523
  }
13392
13524
  };
13393
13525
  //#endregion
13394
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/readBlob.js
13526
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/readBlob.js
13395
13527
  const { asyncIterator } = Symbol;
13396
13528
  const readBlob = async function* (blob) {
13397
13529
  if (blob.stream) yield* blob.stream();
@@ -13400,7 +13532,7 @@ const readBlob = async function* (blob) {
13400
13532
  else yield blob;
13401
13533
  };
13402
13534
  //#endregion
13403
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/formDataToStream.js
13535
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/formDataToStream.js
13404
13536
  const BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
13405
13537
  const textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.default.TextEncoder();
13406
13538
  const CRLF = "\r\n";
@@ -13439,8 +13571,8 @@ var FormDataPart = class {
13439
13571
  };
13440
13572
  const formDataToStream = (form, headersHandler, options) => {
13441
13573
  const { tag = "form-data-boundary", size = 25, boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET) } = options || {};
13442
- if (!utils_default.isFormData(form)) throw TypeError("FormData instance required");
13443
- if (boundary.length < 1 || boundary.length > 70) throw Error("boundary must be 1-70 characters long");
13574
+ if (!utils_default.isFormData(form)) throw new TypeError("FormData instance required");
13575
+ if (boundary.length < 1 || boundary.length > 70) throw new Error("boundary must be 1-70 characters long");
13444
13576
  const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
13445
13577
  const footerBytes = textEncoder.encode("--" + boundary + "--\r\n");
13446
13578
  let contentLength = footerBytes.byteLength;
@@ -13463,7 +13595,7 @@ const formDataToStream = (form, headersHandler, options) => {
13463
13595
  })());
13464
13596
  };
13465
13597
  //#endregion
13466
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
13598
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
13467
13599
  var ZlibHeaderTransformStream = class extends stream.default.Transform {
13468
13600
  __transform(chunk, encoding, callback) {
13469
13601
  this.push(chunk);
@@ -13483,7 +13615,67 @@ var ZlibHeaderTransformStream = class extends stream.default.Transform {
13483
13615
  }
13484
13616
  };
13485
13617
  //#endregion
13486
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/callbackify.js
13618
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/Http2Sessions.js
13619
+ var Http2Sessions = class {
13620
+ constructor() {
13621
+ this.sessions = Object.create(null);
13622
+ }
13623
+ getSession(authority, options) {
13624
+ options = Object.assign({ sessionTimeout: 1e3 }, options);
13625
+ let authoritySessions = this.sessions[authority];
13626
+ if (authoritySessions) {
13627
+ let len = authoritySessions.length;
13628
+ for (let i = 0; i < len; i++) {
13629
+ const [sessionHandle, sessionOptions] = authoritySessions[i];
13630
+ if (!sessionHandle.destroyed && !sessionHandle.closed && util.default.isDeepStrictEqual(sessionOptions, options)) return sessionHandle;
13631
+ }
13632
+ }
13633
+ const session = http2.default.connect(authority, options);
13634
+ let removed;
13635
+ let timer;
13636
+ const removeSession = () => {
13637
+ if (removed) return;
13638
+ removed = true;
13639
+ if (timer) {
13640
+ clearTimeout(timer);
13641
+ timer = null;
13642
+ }
13643
+ let entries = authoritySessions, len = entries.length, i = len;
13644
+ while (i--) if (entries[i][0] === session) {
13645
+ if (len === 1) delete this.sessions[authority];
13646
+ else entries.splice(i, 1);
13647
+ if (!session.closed) session.close();
13648
+ return;
13649
+ }
13650
+ };
13651
+ const originalRequestFn = session.request;
13652
+ const { sessionTimeout } = options;
13653
+ if (sessionTimeout != null) {
13654
+ let streamsCount = 0;
13655
+ session.request = function() {
13656
+ const stream = originalRequestFn.apply(this, arguments);
13657
+ streamsCount++;
13658
+ if (timer) {
13659
+ clearTimeout(timer);
13660
+ timer = null;
13661
+ }
13662
+ stream.once("close", () => {
13663
+ if (!--streamsCount) timer = setTimeout(() => {
13664
+ timer = null;
13665
+ removeSession();
13666
+ }, sessionTimeout);
13667
+ });
13668
+ return stream;
13669
+ };
13670
+ }
13671
+ session.once("close", removeSession);
13672
+ let entry = [session, options];
13673
+ authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
13674
+ return session;
13675
+ }
13676
+ };
13677
+ //#endregion
13678
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/callbackify.js
13487
13679
  const callbackify = (fn, reducer) => {
13488
13680
  return utils_default.isAsyncFn(fn) ? function(...args) {
13489
13681
  const cb = args.pop();
@@ -13497,14 +13689,29 @@ const callbackify = (fn, reducer) => {
13497
13689
  } : fn;
13498
13690
  };
13499
13691
  //#endregion
13500
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/shouldBypassProxy.js
13501
- const LOOPBACK_HOSTNAMES = new Set(["localhost"]);
13692
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/shouldBypassProxy.js
13693
+ const LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
13502
13694
  const isIPv4Loopback = (host) => {
13503
13695
  const parts = host.split(".");
13504
13696
  if (parts.length !== 4) return false;
13505
13697
  if (parts[0] !== "127") return false;
13506
13698
  return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
13507
13699
  };
13700
+ const isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group);
13701
+ const isIPv6Unspecified = (host) => {
13702
+ if (host === "::") return true;
13703
+ const compressionIndex = host.indexOf("::");
13704
+ if (compressionIndex !== -1) {
13705
+ if (compressionIndex !== host.lastIndexOf("::")) return false;
13706
+ const left = host.slice(0, compressionIndex);
13707
+ const right = host.slice(compressionIndex + 2);
13708
+ const leftGroups = left ? left.split(":") : [];
13709
+ const rightGroups = right ? right.split(":") : [];
13710
+ return leftGroups.length + rightGroups.length < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup);
13711
+ }
13712
+ const groups = host.split(":");
13713
+ return groups.length === 8 && groups.every(isIPv6ZeroGroup);
13714
+ };
13508
13715
  const isIPv6Loopback = (host) => {
13509
13716
  if (host === "::1") return true;
13510
13717
  const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
@@ -13525,6 +13732,7 @@ const isLoopback = (host) => {
13525
13732
  if (!host) return false;
13526
13733
  if (LOOPBACK_HOSTNAMES.has(host)) return true;
13527
13734
  if (isIPv4Loopback(host)) return true;
13735
+ if (isIPv6Unspecified(host)) return true;
13528
13736
  return isIPv6Loopback(host);
13529
13737
  };
13530
13738
  const DEFAULT_PORTS = {
@@ -13597,7 +13805,7 @@ function shouldBypassProxy(location) {
13597
13805
  });
13598
13806
  }
13599
13807
  //#endregion
13600
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/speedometer.js
13808
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/speedometer.js
13601
13809
  /**
13602
13810
  * Calculate data maxRate
13603
13811
  * @param {Number} [samplesCount= 10]
@@ -13632,7 +13840,7 @@ function speedometer(samplesCount, min) {
13632
13840
  };
13633
13841
  }
13634
13842
  //#endregion
13635
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/throttle.js
13843
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/throttle.js
13636
13844
  /**
13637
13845
  * Throttle decorator
13638
13846
  * @param {Function} fn
@@ -13669,7 +13877,7 @@ function throttle(fn, freq) {
13669
13877
  return [throttled, flush];
13670
13878
  }
13671
13879
  //#endregion
13672
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/progressEventReducer.js
13880
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/progressEventReducer.js
13673
13881
  const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
13674
13882
  let bytesNotified = 0;
13675
13883
  const _speedometer = speedometer(50, 250);
@@ -13704,16 +13912,18 @@ const progressEventDecorator = (total, throttled) => {
13704
13912
  };
13705
13913
  const asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
13706
13914
  //#endregion
13707
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
13915
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
13708
13916
  /**
13709
13917
  * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
13710
13918
  * - For base64: compute exact decoded size using length and padding;
13711
13919
  * handle %XX at the character-count level (no string allocation).
13712
- * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
13920
+ * - For non-base64: compute the exact percent-decoded UTF-8 byte length.
13713
13921
  *
13714
13922
  * @param {string} url
13715
13923
  * @returns {number}
13716
13924
  */
13925
+ const isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
13926
+ const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
13717
13927
  function estimateDataURLDecodedBytes(url) {
13718
13928
  if (!url || typeof url !== "string") return 0;
13719
13929
  if (!url.startsWith("data:")) return 0;
@@ -13727,7 +13937,7 @@ function estimateDataURLDecodedBytes(url) {
13727
13937
  for (let i = 0; i < len; i++) if (body.charCodeAt(i) === 37 && i + 2 < len) {
13728
13938
  const a = body.charCodeAt(i + 1);
13729
13939
  const b = body.charCodeAt(i + 2);
13730
- if ((a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102)) {
13940
+ if (isHexDigit(a) && isHexDigit(b)) {
13731
13941
  effectiveLen -= 2;
13732
13942
  i += 2;
13733
13943
  }
@@ -13751,11 +13961,13 @@ function estimateDataURLDecodedBytes(url) {
13751
13961
  const bytes = Math.floor(effectiveLen / 4) * 3 - (pad || 0);
13752
13962
  return bytes > 0 ? bytes : 0;
13753
13963
  }
13754
- if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") return Buffer.byteLength(body, "utf8");
13755
13964
  let bytes = 0;
13756
13965
  for (let i = 0, len = body.length; i < len; i++) {
13757
13966
  const c = body.charCodeAt(i);
13758
- if (c < 128) bytes += 1;
13967
+ if (c === 37 && isPercentEncodedByte(body, i, len)) {
13968
+ bytes += 1;
13969
+ i += 2;
13970
+ } else if (c < 128) bytes += 1;
13759
13971
  else if (c < 2048) bytes += 2;
13760
13972
  else if (c >= 55296 && c <= 56319 && i + 1 < len) {
13761
13973
  const next = body.charCodeAt(i + 1);
@@ -13768,7 +13980,7 @@ function estimateDataURLDecodedBytes(url) {
13768
13980
  return bytes;
13769
13981
  }
13770
13982
  //#endregion
13771
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/adapters/http.js
13983
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/adapters/http.js
13772
13984
  const zlibOptions = {
13773
13985
  flush: zlib.default.constants.Z_SYNC_FLUSH,
13774
13986
  finishFlush: zlib.default.constants.Z_SYNC_FLUSH
@@ -13777,7 +13989,14 @@ const brotliOptions = {
13777
13989
  flush: zlib.default.constants.BROTLI_OPERATION_FLUSH,
13778
13990
  finishFlush: zlib.default.constants.BROTLI_OPERATION_FLUSH
13779
13991
  };
13992
+ const zstdOptions = {
13993
+ flush: zlib.default.constants.ZSTD_e_flush,
13994
+ finishFlush: zlib.default.constants.ZSTD_e_flush
13995
+ };
13780
13996
  const isBrotliSupported = utils_default.isFunction(zlib.default.createBrotliDecompress);
13997
+ const isZstdSupported = utils_default.isFunction(zlib.default.createZstdDecompress);
13998
+ const ACCEPT_ENCODING = "gzip, compress, deflate" + (isBrotliSupported ? ", br" : "");
13999
+ const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ", zstd" : "");
13781
14000
  const { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
13782
14001
  const isHttps = /https:?/;
13783
14002
  const FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"];
@@ -13795,6 +14014,25 @@ const kAxiosCurrentReq = Symbol("axios.http.currentReq");
13795
14014
  const kAxiosInstalledTunnel = Symbol("axios.http.installedTunnel");
13796
14015
  const tunnelingAgentCache = /* @__PURE__ */ new Map();
13797
14016
  const tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
14017
+ const NODE_NATIVE_ENV_PROXY_SUPPORT = {
14018
+ 22: 21,
14019
+ 24: 5
14020
+ };
14021
+ function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {
14022
+ if (!nodeVersion) return false;
14023
+ const [major, minor] = nodeVersion.split(".").map((part) => Number(part));
14024
+ if (!Number.isInteger(major) || !Number.isInteger(minor)) return false;
14025
+ if (major > 24) return true;
14026
+ return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major];
14027
+ }
14028
+ function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {
14029
+ if (!isNodeNativeEnvProxySupported(nodeVersion)) return false;
14030
+ const agentOptions = agent && agent.options;
14031
+ return Boolean(agentOptions && utils_default.hasOwnProp(agentOptions, "proxyEnv") && agentOptions.proxyEnv != null);
14032
+ }
14033
+ function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
14034
+ return isHttps.test(options.protocol) ? configHttpsAgent || https.default.globalAgent : configHttpAgent || http.default.globalAgent;
14035
+ }
13798
14036
  function getTunnelingAgent(agentOptions, userHttpsAgent) {
13799
14037
  const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
13800
14038
  const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache;
@@ -13804,6 +14042,16 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
13804
14042
  ...userHttpsAgent.options,
13805
14043
  ...agentOptions
13806
14044
  } : agentOptions);
14045
+ if (userHttpsAgent && userHttpsAgent.options) {
14046
+ const originTLSOptions = { ...userHttpsAgent.options };
14047
+ const callback = agent.callback;
14048
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
14049
+ return callback.call(this, req, {
14050
+ ...originTLSOptions,
14051
+ ...opts
14052
+ });
14053
+ };
14054
+ }
13807
14055
  agent[kAxiosInstalledTunnel] = true;
13808
14056
  cache.set(key, agent);
13809
14057
  return agent;
@@ -13811,7 +14059,7 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
13811
14059
  const supportedProtocols = platform_default.protocols.map((protocol) => {
13812
14060
  return protocol + ":";
13813
14061
  });
13814
- const decodeURIComponentSafe = (value) => {
14062
+ const decodeURIComponentSafe$1 = (value) => {
13815
14063
  if (!utils_default.isString(value)) return value;
13816
14064
  try {
13817
14065
  return decodeURIComponent(value);
@@ -13823,64 +14071,10 @@ const flushOnFinish = (stream$4, [throttled, flush]) => {
13823
14071
  stream$4.on("end", flush).on("error", flush);
13824
14072
  return throttled;
13825
14073
  };
13826
- var Http2Sessions = class {
13827
- constructor() {
13828
- this.sessions = Object.create(null);
13829
- }
13830
- getSession(authority, options) {
13831
- options = Object.assign({ sessionTimeout: 1e3 }, options);
13832
- let authoritySessions = this.sessions[authority];
13833
- if (authoritySessions) {
13834
- let len = authoritySessions.length;
13835
- for (let i = 0; i < len; i++) {
13836
- const [sessionHandle, sessionOptions] = authoritySessions[i];
13837
- if (!sessionHandle.destroyed && !sessionHandle.closed && util.default.isDeepStrictEqual(sessionOptions, options)) return sessionHandle;
13838
- }
13839
- }
13840
- const session = http2.default.connect(authority, options);
13841
- let removed;
13842
- const removeSession = () => {
13843
- if (removed) return;
13844
- removed = true;
13845
- let entries = authoritySessions, len = entries.length, i = len;
13846
- while (i--) if (entries[i][0] === session) {
13847
- if (len === 1) delete this.sessions[authority];
13848
- else entries.splice(i, 1);
13849
- if (!session.closed) session.close();
13850
- return;
13851
- }
13852
- };
13853
- const originalRequestFn = session.request;
13854
- const { sessionTimeout } = options;
13855
- if (sessionTimeout != null) {
13856
- let timer;
13857
- let streamsCount = 0;
13858
- session.request = function() {
13859
- const stream$5 = originalRequestFn.apply(this, arguments);
13860
- streamsCount++;
13861
- if (timer) {
13862
- clearTimeout(timer);
13863
- timer = null;
13864
- }
13865
- stream$5.once("close", () => {
13866
- if (!--streamsCount) timer = setTimeout(() => {
13867
- timer = null;
13868
- removeSession();
13869
- }, sessionTimeout);
13870
- });
13871
- return stream$5;
13872
- };
13873
- }
13874
- session.once("close", removeSession);
13875
- let entry = [session, options];
13876
- authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
13877
- return session;
13878
- }
13879
- };
13880
14074
  const http2Sessions = new Http2Sessions();
13881
14075
  /**
13882
- * If the proxy or config beforeRedirects functions are defined, call them with the options
13883
- * object.
14076
+ * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined,
14077
+ * call them with the options object.
13884
14078
  *
13885
14079
  * @param {Object<string, any>} options - The options object that was passed to the request.
13886
14080
  *
@@ -13888,8 +14082,24 @@ const http2Sessions = new Http2Sessions();
13888
14082
  */
13889
14083
  function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
13890
14084
  if (options.beforeRedirects.proxy) options.beforeRedirects.proxy(options);
14085
+ if (options.beforeRedirects.auth) options.beforeRedirects.auth(options);
14086
+ if (options.beforeRedirects.sensitiveHeaders) options.beforeRedirects.sensitiveHeaders(options, requestDetails);
13891
14087
  if (options.beforeRedirects.config) options.beforeRedirects.config(options, responseDetails, requestDetails);
13892
14088
  }
14089
+ function stripMatchingHeaders(headers, sensitiveSet) {
14090
+ if (!headers) return;
14091
+ Object.keys(headers).forEach((header) => {
14092
+ if (sensitiveSet.has(header.toLowerCase())) delete headers[header];
14093
+ });
14094
+ }
14095
+ function isSameOriginRedirect(redirectOptions, requestDetails) {
14096
+ if (!requestDetails) return false;
14097
+ try {
14098
+ return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
14099
+ } catch (e) {
14100
+ return false;
14101
+ }
14102
+ }
13893
14103
  /**
13894
14104
  * If the proxy or config afterRedirects functions are defined, call them with the options
13895
14105
  *
@@ -13899,9 +14109,10 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
13899
14109
  *
13900
14110
  * @returns {http.ClientRequestArgs}
13901
14111
  */
13902
- function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {
14112
+ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
13903
14113
  let proxy = configProxy;
13904
- if (!proxy && proxy !== false) {
14114
+ const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
14115
+ if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
13905
14116
  const proxyUrl = getProxyForUrl(location);
13906
14117
  if (proxyUrl) {
13907
14118
  if (!shouldBypassProxy(location)) proxy = new URL(proxyUrl);
@@ -13965,7 +14176,7 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
13965
14176
  }
13966
14177
  }
13967
14178
  options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
13968
- setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);
14179
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
13969
14180
  };
13970
14181
  }
13971
14182
  const isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
@@ -14027,16 +14238,25 @@ const http2Transport = { request(options, cb) {
14027
14238
  } };
14028
14239
  var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14029
14240
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
14030
- const own = (key) => utils_default.hasOwnProp(config, key) ? config[key] : void 0;
14241
+ const own = (key) => utils_default.getSafeProp(config, key);
14242
+ const transitional = own("transitional") || transitional_default;
14031
14243
  let data = own("data");
14032
14244
  let lookup = own("lookup");
14033
14245
  let family = own("family");
14034
14246
  let httpVersion = own("httpVersion");
14035
14247
  if (httpVersion === void 0) httpVersion = 1;
14036
14248
  let http2Options = own("http2Options");
14249
+ const httpAgent = own("httpAgent");
14250
+ const httpsAgent = own("httpsAgent");
14251
+ const configProxy = own("proxy");
14037
14252
  const responseType = own("responseType");
14038
14253
  const responseEncoding = own("responseEncoding");
14039
- const method = config.method.toUpperCase();
14254
+ const socketPath = own("socketPath");
14255
+ const method = own("method").toUpperCase();
14256
+ const maxRedirects = own("maxRedirects");
14257
+ const maxBodyLength = own("maxBodyLength");
14258
+ const maxContentLength = own("maxContentLength");
14259
+ const decompress = own("decompress");
14040
14260
  let isDone;
14041
14261
  let rejected = false;
14042
14262
  let req;
@@ -14059,9 +14279,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14059
14279
  function abort(reason) {
14060
14280
  try {
14061
14281
  abortEmitter.emit("abort", !reason || reason.type ? new CanceledError$1(null, config, req) : reason);
14062
- } catch (err) {
14063
- console.warn("emit error", err);
14064
- }
14282
+ } catch (err) {}
14065
14283
  }
14066
14284
  function clearConnectPhaseTimer() {
14067
14285
  if (connectPhaseTimer) {
@@ -14070,9 +14288,10 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14070
14288
  }
14071
14289
  }
14072
14290
  function createTimeoutError() {
14073
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
14074
- const transitional = config.transitional || transitional_default;
14075
- if (config.timeoutErrorMessage) timeoutErrorMessage = config.timeoutErrorMessage;
14291
+ const configTimeout = own("timeout");
14292
+ let timeoutErrorMessage = configTimeout ? "timeout of " + configTimeout + "ms exceeded" : "timeout exceeded";
14293
+ const configTimeoutErrorMessage = own("timeoutErrorMessage");
14294
+ if (configTimeoutErrorMessage) timeoutErrorMessage = configTimeoutErrorMessage;
14076
14295
  return new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, req);
14077
14296
  }
14078
14297
  abortEmitter.once("abort", reject);
@@ -14102,12 +14321,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14102
14321
  });
14103
14322
  } else onFinished();
14104
14323
  });
14105
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
14106
- const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
14324
+ const fullPath = buildFullPath(own("baseURL"), own("url"), own("allowAbsoluteUrls"), config);
14325
+ const urlBase = socketPath ? "http://localhost" : platform_default.hasBrowserEnv ? platform_default.origin : void 0;
14326
+ const parsed = new URL(fullPath, urlBase);
14107
14327
  const protocol = parsed.protocol || supportedProtocols[0];
14108
14328
  if (protocol === "data:") {
14109
- if (config.maxContentLength > -1) {
14110
- if (estimateDataURLDecodedBytes(String(config.url || fullPath || "")) > config.maxContentLength) return reject(new AxiosError$1("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError$1.ERR_BAD_RESPONSE, config));
14329
+ if (maxContentLength > -1) {
14330
+ if (estimateDataURLDecodedBytes(String(own("url") || fullPath || "")) > maxContentLength) return reject(new AxiosError$1("maxContentLength size of " + maxContentLength + " exceeded", AxiosError$1.ERR_BAD_RESPONSE, config));
14111
14331
  }
14112
14332
  let convertedData;
14113
14333
  if (method !== "GET") return settle(resolve, reject, {
@@ -14117,7 +14337,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14117
14337
  config
14118
14338
  });
14119
14339
  try {
14120
- convertedData = fromDataURI(config.url, responseType === "blob", { Blob: config.env && config.env.Blob });
14340
+ convertedData = fromDataURI(own("url"), responseType === "blob", { Blob: config.env && config.env.Blob });
14121
14341
  } catch (err) {
14122
14342
  throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
14123
14343
  }
@@ -14135,7 +14355,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14135
14355
  }
14136
14356
  if (supportedProtocols.indexOf(protocol) === -1) return reject(new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_BAD_REQUEST, config));
14137
14357
  const headers = AxiosHeaders$1.from(config.headers).normalize();
14138
- headers.set("User-Agent", "axios/1.16.1", false);
14358
+ headers.set("User-Agent", "axios/1.18.1", false);
14139
14359
  const { onUploadProgress, onDownloadProgress } = config;
14140
14360
  const maxRate = config.maxRate;
14141
14361
  let maxUploadRate = void 0;
@@ -14145,7 +14365,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14145
14365
  data = formDataToStream(data, (formHeaders) => {
14146
14366
  headers.set(formHeaders);
14147
14367
  }, {
14148
- tag: `axios-1.16.1-boundary`,
14368
+ tag: `axios-1.18.1-boundary`,
14149
14369
  boundary: userBoundary && userBoundary[1] || void 0
14150
14370
  });
14151
14371
  } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
@@ -14163,7 +14383,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14163
14383
  else if (utils_default.isString(data)) data = Buffer.from(data, "utf-8");
14164
14384
  else return reject(new AxiosError$1("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError$1.ERR_BAD_REQUEST, config));
14165
14385
  headers.setContentLength(data.length, false);
14166
- if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) return reject(new AxiosError$1("Request body larger than maxBodyLength limit", AxiosError$1.ERR_BAD_REQUEST, config));
14386
+ if (maxBodyLength > -1 && data.length > maxBodyLength) return reject(new AxiosError$1("Request body larger than maxBodyLength limit", AxiosError$1.ERR_BAD_REQUEST, config));
14167
14387
  }
14168
14388
  const contentLength = utils_default.toFiniteNumber(headers.getContentLength());
14169
14389
  if (utils_default.isArray(maxRate)) {
@@ -14178,34 +14398,33 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14178
14398
  let auth = void 0;
14179
14399
  const configAuth = own("auth");
14180
14400
  if (configAuth) {
14181
- const username = configAuth.username || "";
14182
- const password = configAuth.password || "";
14401
+ const username = utils_default.getSafeProp(configAuth, "username") || "";
14402
+ const password = utils_default.getSafeProp(configAuth, "password") || "";
14183
14403
  auth = username + ":" + password;
14184
14404
  }
14185
- if (!auth && parsed.username) {
14186
- const urlUsername = decodeURIComponentSafe(parsed.username);
14187
- const urlPassword = decodeURIComponentSafe(parsed.password);
14405
+ if (!auth && (parsed.username || parsed.password)) {
14406
+ const urlUsername = decodeURIComponentSafe$1(parsed.username);
14407
+ const urlPassword = decodeURIComponentSafe$1(parsed.password);
14188
14408
  auth = urlUsername + ":" + urlPassword;
14189
14409
  }
14190
14410
  auth && headers.delete("authorization");
14191
14411
  let path$2;
14192
14412
  try {
14193
- path$2 = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, "");
14413
+ path$2 = buildURL(parsed.pathname + parsed.search, own("params"), own("paramsSerializer")).replace(/^\?/, "");
14194
14414
  } catch (err) {
14195
- const customErr = new Error(err.message);
14196
- customErr.config = config;
14197
- customErr.url = config.url;
14198
- customErr.exists = true;
14199
- return reject(customErr);
14415
+ return reject(AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config, null, null, {
14416
+ url: own("url"),
14417
+ exists: true
14418
+ }));
14200
14419
  }
14201
- headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
14420
+ headers.set("Accept-Encoding", utils_default.hasOwnProp(transitional, "advertiseZstdAcceptEncoding") && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
14202
14421
  const options = Object.assign(Object.create(null), {
14203
14422
  path: path$2,
14204
14423
  method,
14205
14424
  headers: toByteStringHeaderObject(headers),
14206
14425
  agents: {
14207
- http: config.httpAgent,
14208
- https: config.httpsAgent
14426
+ http: httpAgent,
14427
+ https: httpsAgent
14209
14428
  },
14210
14429
  auth,
14211
14430
  protocol,
@@ -14215,38 +14434,66 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14215
14434
  http2Options
14216
14435
  });
14217
14436
  !utils_default.isUndefined(lookup) && (options.lookup = lookup);
14218
- if (config.socketPath) {
14219
- if (typeof config.socketPath !== "string") return reject(new AxiosError$1("socketPath must be a string", AxiosError$1.ERR_BAD_OPTION_VALUE, config));
14220
- if (config.allowedSocketPaths != null) {
14221
- const allowed = Array.isArray(config.allowedSocketPaths) ? config.allowedSocketPaths : [config.allowedSocketPaths];
14222
- const resolvedSocket = (0, path.resolve)(config.socketPath);
14223
- if (!allowed.some((entry) => typeof entry === "string" && (0, path.resolve)(entry) === resolvedSocket)) return reject(new AxiosError$1(`socketPath "${config.socketPath}" is not permitted by allowedSocketPaths`, AxiosError$1.ERR_BAD_OPTION_VALUE, config));
14437
+ if (socketPath) {
14438
+ if (typeof socketPath !== "string") return reject(new AxiosError$1("socketPath must be a string", AxiosError$1.ERR_BAD_OPTION_VALUE, config));
14439
+ const allowedSocketPaths = own("allowedSocketPaths");
14440
+ if (allowedSocketPaths != null) {
14441
+ const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths];
14442
+ const resolvedSocket = (0, path.resolve)(socketPath);
14443
+ if (!allowed.some((entry) => typeof entry === "string" && (0, path.resolve)(entry) === resolvedSocket)) return reject(new AxiosError$1(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError$1.ERR_BAD_OPTION_VALUE, config));
14224
14444
  }
14225
- options.socketPath = config.socketPath;
14445
+ options.socketPath = socketPath;
14226
14446
  } else {
14227
14447
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
14228
14448
  options.port = parsed.port;
14229
- setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, config.httpsAgent);
14449
+ setProxy(options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, httpAgent);
14230
14450
  }
14231
14451
  let transport;
14232
14452
  let isNativeTransport = false;
14453
+ let transportEnforcesMaxBodyLength = false;
14233
14454
  const isHttpsRequest = isHttps.test(options.protocol);
14234
- if (options.agent == null) options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
14455
+ if (options.agent == null) options.agent = isHttpsRequest ? httpsAgent : httpAgent;
14235
14456
  if (isHttp2) transport = http2Transport;
14236
14457
  else {
14237
14458
  const configTransport = own("transport");
14238
14459
  if (configTransport) transport = configTransport;
14239
- else if (config.maxRedirects === 0) {
14460
+ else if (maxRedirects === 0) {
14240
14461
  transport = isHttpsRequest ? https.default : http.default;
14241
14462
  isNativeTransport = true;
14242
14463
  } else {
14243
- if (config.maxRedirects) options.maxRedirects = config.maxRedirects;
14464
+ transportEnforcesMaxBodyLength = true;
14465
+ options.sensitiveHeaders = [];
14466
+ if (maxRedirects) options.maxRedirects = maxRedirects;
14244
14467
  const configBeforeRedirect = own("beforeRedirect");
14245
14468
  if (configBeforeRedirect) options.beforeRedirects.config = configBeforeRedirect;
14469
+ if (auth) {
14470
+ const requestOrigin = parsed.origin;
14471
+ const authToRestore = auth;
14472
+ options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) {
14473
+ try {
14474
+ if (new URL(redirectOptions.href).origin === requestOrigin) redirectOptions.auth = authToRestore;
14475
+ } catch (e) {}
14476
+ };
14477
+ }
14478
+ const sensitiveHeaders = own("sensitiveHeaders");
14479
+ if (sensitiveHeaders != null) {
14480
+ if (!utils_default.isArray(sensitiveHeaders)) return reject(new AxiosError$1("sensitiveHeaders must be an array of strings", AxiosError$1.ERR_BAD_OPTION_VALUE, config));
14481
+ const sensitiveSet = /* @__PURE__ */ new Set();
14482
+ for (const header of sensitiveHeaders) {
14483
+ if (!utils_default.isString(header)) return reject(new AxiosError$1("sensitiveHeaders must be an array of strings", AxiosError$1.ERR_BAD_OPTION_VALUE, config));
14484
+ sensitiveSet.add(header.toLowerCase());
14485
+ }
14486
+ if (sensitiveSet.size) {
14487
+ options.sensitiveHeaders = Array.from(sensitiveSet);
14488
+ options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) {
14489
+ if (!isSameOriginRedirect(redirectOptions, requestDetails)) stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
14490
+ };
14491
+ }
14492
+ }
14246
14493
  transport = isHttpsRequest ? httpsFollow : httpFollow;
14247
14494
  }
14248
14495
  }
14249
- if (config.maxBodyLength > -1) options.maxBodyLength = config.maxBodyLength;
14496
+ if (maxBodyLength > -1) options.maxBodyLength = maxBodyLength;
14250
14497
  else options.maxBodyLength = Infinity;
14251
14498
  options.insecureHTTPParser = Boolean(own("insecureHTTPParser"));
14252
14499
  req = transport.request(options, function handleResponse(res) {
@@ -14261,7 +14508,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14261
14508
  }
14262
14509
  let responseStream = res;
14263
14510
  const lastRequest = res.req || req;
14264
- if (config.decompress !== false && res.headers["content-encoding"]) {
14511
+ if (decompress !== false && res.headers["content-encoding"]) {
14265
14512
  if (method === "HEAD" || res.statusCode === 204) delete res.headers["content-encoding"];
14266
14513
  switch ((res.headers["content-encoding"] || "").toLowerCase()) {
14267
14514
  case "gzip":
@@ -14276,10 +14523,18 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14276
14523
  streams.push(zlib.default.createUnzip(zlibOptions));
14277
14524
  delete res.headers["content-encoding"];
14278
14525
  break;
14279
- case "br": if (isBrotliSupported) {
14280
- streams.push(zlib.default.createBrotliDecompress(brotliOptions));
14281
- delete res.headers["content-encoding"];
14282
- }
14526
+ case "br":
14527
+ if (isBrotliSupported) {
14528
+ streams.push(zlib.default.createBrotliDecompress(brotliOptions));
14529
+ delete res.headers["content-encoding"];
14530
+ }
14531
+ break;
14532
+ case "zstd":
14533
+ if (isZstdSupported) {
14534
+ streams.push(zlib.default.createZstdDecompress(zstdOptions));
14535
+ delete res.headers["content-encoding"];
14536
+ }
14537
+ break;
14283
14538
  }
14284
14539
  }
14285
14540
  responseStream = streams.length > 1 ? stream.default.pipeline(streams, utils_default.noop) : streams[0];
@@ -14291,8 +14546,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14291
14546
  request: lastRequest
14292
14547
  };
14293
14548
  if (responseType === "stream") {
14294
- if (config.maxContentLength > -1) {
14295
- const limit = config.maxContentLength;
14549
+ if (maxContentLength > -1) {
14550
+ const limit = maxContentLength;
14296
14551
  const source = responseStream;
14297
14552
  async function* enforceMaxContentLength() {
14298
14553
  let totalResponseBytes = 0;
@@ -14312,10 +14567,10 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14312
14567
  responseStream.on("data", function handleStreamData(chunk) {
14313
14568
  responseBuffer.push(chunk);
14314
14569
  totalResponseBytes += chunk.length;
14315
- if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
14570
+ if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
14316
14571
  rejected = true;
14317
14572
  responseStream.destroy();
14318
- abort(new AxiosError$1("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
14573
+ abort(new AxiosError$1("maxContentLength size of " + maxContentLength + " exceeded", AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
14319
14574
  }
14320
14575
  });
14321
14576
  responseStream.on("aborted", function handlerStreamAborted() {
@@ -14358,7 +14613,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14358
14613
  });
14359
14614
  const boundSockets = /* @__PURE__ */ new Set();
14360
14615
  req.on("socket", function handleRequestSocket(socket) {
14361
- socket.setKeepAlive(true, 1e3 * 60);
14616
+ if (typeof socket.setKeepAlive === "function") socket.setKeepAlive(true, 1e3 * 60);
14362
14617
  if (!socket[kAxiosSocketListener]) {
14363
14618
  socket.on("error", function handleSocketError(err) {
14364
14619
  const current = socket[kAxiosCurrentReq];
@@ -14374,8 +14629,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14374
14629
  for (const socket of boundSockets) if (socket[kAxiosCurrentReq] === req) socket[kAxiosCurrentReq] = null;
14375
14630
  boundSockets.clear();
14376
14631
  });
14377
- if (config.timeout) {
14378
- const timeout = parseInt(config.timeout, 10);
14632
+ if (own("timeout")) {
14633
+ const timeout = parseInt(own("timeout"), 10);
14379
14634
  if (Number.isNaN(timeout)) {
14380
14635
  abort(new AxiosError$1("error trying to parse `config.timeout` to int", AxiosError$1.ERR_BAD_OPTION_VALUE, config, req));
14381
14636
  return;
@@ -14401,8 +14656,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14401
14656
  if (!ended && !errored) abort(new CanceledError$1("Request stream has been aborted", config, req));
14402
14657
  });
14403
14658
  let uploadStream = data;
14404
- if (config.maxBodyLength > -1 && config.maxRedirects === 0) {
14405
- const limit = config.maxBodyLength;
14659
+ if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
14660
+ const limit = maxBodyLength;
14406
14661
  let bytesSent = 0;
14407
14662
  uploadStream = stream.default.pipeline([data, new stream.default.Transform({ transform(chunk, _enc, cb) {
14408
14663
  bytesSent += chunk.length;
@@ -14421,13 +14676,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
14421
14676
  });
14422
14677
  };
14423
14678
  //#endregion
14424
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/isURLSameOrigin.js
14679
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/isURLSameOrigin.js
14425
14680
  var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
14426
14681
  url = new URL(url, platform_default.origin);
14427
14682
  return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
14428
14683
  })(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
14429
14684
  //#endregion
14430
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/cookies.js
14685
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/cookies.js
14431
14686
  var cookies_default = platform_default.hasStandardBrowserEnv ? {
14432
14687
  write(name, value, expires, path, domain, secure, sameSite) {
14433
14688
  if (typeof document === "undefined") return;
@@ -14445,7 +14700,11 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? {
14445
14700
  for (let i = 0; i < cookies.length; i++) {
14446
14701
  const cookie = cookies[i].replace(/^\s+/, "");
14447
14702
  const eq = cookie.indexOf("=");
14448
- if (eq !== -1 && cookie.slice(0, eq) === name) return decodeURIComponent(cookie.slice(eq + 1));
14703
+ if (eq !== -1 && cookie.slice(0, eq) === name) try {
14704
+ return decodeURIComponent(cookie.slice(eq + 1));
14705
+ } catch (e) {
14706
+ return cookie.slice(eq + 1);
14707
+ }
14449
14708
  }
14450
14709
  return null;
14451
14710
  },
@@ -14460,7 +14719,7 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? {
14460
14719
  remove() {}
14461
14720
  };
14462
14721
  //#endregion
14463
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/mergeConfig.js
14722
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/mergeConfig.js
14464
14723
  const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
14465
14724
  /**
14466
14725
  * Config-specific merge-function which creates a new config-object
@@ -14472,6 +14731,7 @@ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing
14472
14731
  * @returns {Object} New object resulting from merging config2 to config1
14473
14732
  */
14474
14733
  function mergeConfig$1(config1, config2) {
14734
+ config1 = config1 || {};
14475
14735
  config2 = config2 || {};
14476
14736
  const config = Object.create(null);
14477
14737
  Object.defineProperty(config, "hasOwnProperty", {
@@ -14498,6 +14758,14 @@ function mergeConfig$1(config1, config2) {
14498
14758
  if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b);
14499
14759
  else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a);
14500
14760
  }
14761
+ function getMergedTransitionalOption(prop) {
14762
+ const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
14763
+ if (!utils_default.isUndefined(transitional2)) if (utils_default.isPlainObject(transitional2)) {
14764
+ if (utils_default.hasOwnProp(transitional2, prop)) return transitional2[prop];
14765
+ } else return;
14766
+ const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
14767
+ if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) return transitional1[prop];
14768
+ }
14501
14769
  function mergeDirectKeys(a, b, prop) {
14502
14770
  if (utils_default.hasOwnProp(config2, prop)) return getMergedValue(a, b);
14503
14771
  else if (utils_default.hasOwnProp(config1, prop)) return getMergedValue(void 0, a);
@@ -14543,17 +14811,19 @@ function mergeConfig$1(config1, config2) {
14543
14811
  const configValue = merge(utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0, utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0, prop);
14544
14812
  utils_default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
14545
14813
  });
14814
+ if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) if (utils_default.hasOwnProp(config1, "validateStatus")) config.validateStatus = getMergedValue(void 0, config1.validateStatus);
14815
+ else delete config.validateStatus;
14546
14816
  return config;
14547
14817
  }
14548
14818
  //#endregion
14549
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/resolveConfig.js
14819
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/resolveConfig.js
14550
14820
  const FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
14551
14821
  function setFormDataHeaders(headers, formHeaders, policy) {
14552
14822
  if (policy !== "content-only") {
14553
14823
  headers.set(formHeaders);
14554
14824
  return;
14555
14825
  }
14556
- Object.entries(formHeaders).forEach(([key, val]) => {
14826
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
14557
14827
  if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) headers.set(key, val);
14558
14828
  });
14559
14829
  }
@@ -14565,8 +14835,8 @@ function setFormDataHeaders(headers, formHeaders, policy) {
14565
14835
  *
14566
14836
  * @returns {string} UTF-8 bytes as a Latin-1 string
14567
14837
  */
14568
- const encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
14569
- var resolveConfig_default = (config) => {
14838
+ const encodeUTF8$1 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
14839
+ function resolveConfig(config) {
14570
14840
  const newConfig = mergeConfig$1({}, config);
14571
14841
  const own = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
14572
14842
  const data = own("data");
@@ -14579,10 +14849,18 @@ var resolveConfig_default = (config) => {
14579
14849
  const allowAbsoluteUrls = own("allowAbsoluteUrls");
14580
14850
  const url = own("url");
14581
14851
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
14582
- newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer);
14583
- if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : "")));
14852
+ newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own("params"), own("paramsSerializer"));
14853
+ if (auth) {
14854
+ const username = utils_default.getSafeProp(auth, "username") || "";
14855
+ const password = utils_default.getSafeProp(auth, "password") || "";
14856
+ try {
14857
+ headers.set("Authorization", "Basic " + btoa(username + ":" + (password ? encodeUTF8$1(password) : "")));
14858
+ } catch (e) {
14859
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_OPTION_VALUE, config);
14860
+ }
14861
+ }
14584
14862
  if (utils_default.isFormData(data)) {
14585
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0);
14863
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) headers.setContentType(void 0);
14586
14864
  else if (utils_default.isFunction(data.getHeaders)) setFormDataHeaders(headers, data.getHeaders(), own("formDataHeaderPolicy"));
14587
14865
  }
14588
14866
  if (platform_default.hasStandardBrowserEnv) {
@@ -14593,10 +14871,10 @@ var resolveConfig_default = (config) => {
14593
14871
  }
14594
14872
  }
14595
14873
  return newConfig;
14596
- };
14874
+ }
14597
14875
  var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) {
14598
14876
  return new Promise(function dispatchXhrRequest(resolve, reject) {
14599
- const _config = resolveConfig_default(config);
14877
+ const _config = resolveConfig(config);
14600
14878
  let requestData = _config.data;
14601
14879
  const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
14602
14880
  let { responseType, onUploadProgress, onDownloadProgress } = _config;
@@ -14687,13 +14965,14 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) {
14687
14965
  const protocol = parseProtocol(_config.url);
14688
14966
  if (protocol && !platform_default.protocols.includes(protocol)) {
14689
14967
  reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
14968
+ done();
14690
14969
  return;
14691
14970
  }
14692
14971
  request.send(requestData || null);
14693
14972
  });
14694
14973
  };
14695
14974
  //#endregion
14696
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/composeSignals.js
14975
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/composeSignals.js
14697
14976
  const composeSignals = (signals, timeout) => {
14698
14977
  signals = signals ? signals.filter(Boolean) : [];
14699
14978
  if (!timeout && !signals.length) return;
@@ -14720,13 +14999,13 @@ const composeSignals = (signals, timeout) => {
14720
14999
  });
14721
15000
  signals = null;
14722
15001
  };
14723
- signals.forEach((signal) => signal.addEventListener("abort", onabort));
15002
+ signals.forEach((signal) => signal.addEventListener("abort", onabort, { once: true }));
14724
15003
  const { signal } = controller;
14725
15004
  signal.unsubscribe = () => utils_default.asap(unsubscribe);
14726
15005
  return signal;
14727
15006
  };
14728
15007
  //#endregion
14729
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/trackStream.js
15008
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/trackStream.js
14730
15009
  const streamChunk = function* (chunk, chunkSize) {
14731
15010
  let len = chunk.byteLength;
14732
15011
  if (!chunkSize || len < chunkSize) {
@@ -14794,9 +15073,26 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
14794
15073
  }, { highWaterMark: 2 });
14795
15074
  };
14796
15075
  //#endregion
14797
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/adapters/fetch.js
15076
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/adapters/fetch.js
14798
15077
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
14799
15078
  const { isFunction } = utils_default;
15079
+ /**
15080
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
15081
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
15082
+ *
15083
+ * @param {string} str The string to encode
15084
+ *
15085
+ * @returns {string} UTF-8 bytes as a Latin-1 string
15086
+ */
15087
+ const encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
15088
+ const decodeURIComponentSafe = (value) => {
15089
+ if (!utils_default.isString(value)) return value;
15090
+ try {
15091
+ return decodeURIComponent(value);
15092
+ } catch (error) {
15093
+ return value;
15094
+ }
15095
+ };
14800
15096
  const test = (fn, ...args) => {
14801
15097
  try {
14802
15098
  return !!fn(...args);
@@ -14804,6 +15100,12 @@ const test = (fn, ...args) => {
14804
15100
  return false;
14805
15101
  }
14806
15102
  };
15103
+ const maybeWithAuthCredentials = (url) => {
15104
+ const protocolIndex = url.indexOf("://");
15105
+ let urlToCheck = url;
15106
+ if (protocolIndex !== -1) urlToCheck = urlToCheck.slice(protocolIndex + 3);
15107
+ return urlToCheck.includes("@") || urlToCheck.includes(":");
15108
+ };
14807
15109
  const factory = (env) => {
14808
15110
  const globalObject = utils_default.global !== void 0 && utils_default.global !== null ? utils_default.global : globalThis;
14809
15111
  const { ReadableStream, TextEncoder } = globalObject;
@@ -14834,19 +15136,21 @@ const factory = (env) => {
14834
15136
  });
14835
15137
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
14836
15138
  const resolvers = { stream: supportsResponseStream && ((res) => res.body) };
14837
- isFetchSupported && [
14838
- "text",
14839
- "arrayBuffer",
14840
- "blob",
14841
- "formData",
14842
- "stream"
14843
- ].forEach((type) => {
14844
- !resolvers[type] && (resolvers[type] = (res, config) => {
14845
- let method = res && res[type];
14846
- if (method) return method.call(res);
14847
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
15139
+ isFetchSupported && (() => {
15140
+ [
15141
+ "text",
15142
+ "arrayBuffer",
15143
+ "blob",
15144
+ "formData",
15145
+ "stream"
15146
+ ].forEach((type) => {
15147
+ !resolvers[type] && (resolvers[type] = (res, config) => {
15148
+ let method = res && res[type];
15149
+ if (method) return method.call(res);
15150
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
15151
+ });
14848
15152
  });
14849
- });
15153
+ })();
14850
15154
  const getBodyLength = async (body) => {
14851
15155
  if (body == null) return 0;
14852
15156
  if (utils_default.isBlob(body)) return body.size;
@@ -14863,9 +15167,10 @@ const factory = (env) => {
14863
15167
  return length == null ? getBodyLength(body) : length;
14864
15168
  };
14865
15169
  return async (config) => {
14866
- let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions, maxContentLength, maxBodyLength } = resolveConfig_default(config);
15170
+ let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions, maxContentLength, maxBodyLength } = resolveConfig(config);
14867
15171
  const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1;
14868
15172
  const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1;
15173
+ const own = (key) => utils_default.hasOwnProp(config, key) ? config[key] : void 0;
14869
15174
  let _fetch = envFetch || fetch;
14870
15175
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
14871
15176
  let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
@@ -14874,34 +15179,70 @@ const factory = (env) => {
14874
15179
  composedSignal.unsubscribe();
14875
15180
  });
14876
15181
  let requestContentLength;
15182
+ let pendingBodyError = null;
15183
+ const maxBodyLengthError = () => new AxiosError$1("Request body larger than maxBodyLength limit", AxiosError$1.ERR_BAD_REQUEST, config, request);
14877
15184
  try {
15185
+ let auth = void 0;
15186
+ const configAuth = own("auth");
15187
+ if (configAuth) auth = {
15188
+ username: utils_default.getSafeProp(configAuth, "username") || "",
15189
+ password: utils_default.getSafeProp(configAuth, "password") || ""
15190
+ };
15191
+ if (maybeWithAuthCredentials(url)) {
15192
+ const parsedURL = new URL(url, platform_default.origin);
15193
+ if (!auth && (parsedURL.username || parsedURL.password)) auth = {
15194
+ username: decodeURIComponentSafe(parsedURL.username),
15195
+ password: decodeURIComponentSafe(parsedURL.password)
15196
+ };
15197
+ if (parsedURL.username || parsedURL.password) {
15198
+ parsedURL.username = "";
15199
+ parsedURL.password = "";
15200
+ url = parsedURL.href;
15201
+ }
15202
+ }
15203
+ if (auth) {
15204
+ headers.delete("authorization");
15205
+ headers.set("Authorization", "Basic " + btoa(encodeUTF8((auth.username || "") + ":" + (auth.password || ""))));
15206
+ }
14878
15207
  if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) {
14879
15208
  if (estimateDataURLDecodedBytes(url) > maxContentLength) throw new AxiosError$1("maxContentLength size of " + maxContentLength + " exceeded", AxiosError$1.ERR_BAD_RESPONSE, config, request);
14880
15209
  }
14881
15210
  if (hasMaxBodyLength && method !== "get" && method !== "head") {
14882
- const outboundLength = await resolveBodyLength(headers, data);
14883
- if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) throw new AxiosError$1("Request body larger than maxBodyLength limit", AxiosError$1.ERR_BAD_REQUEST, config, request);
14884
- }
14885
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
14886
- let _request = new Request(url, {
14887
- method: "POST",
14888
- body: data,
14889
- duplex: "half"
14890
- });
14891
- let contentTypeHeader;
14892
- if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) headers.setContentType(contentTypeHeader);
14893
- if (_request.body) {
14894
- const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
14895
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
15211
+ const outboundLength = await getBodyLength(data);
15212
+ if (typeof outboundLength === "number" && isFinite(outboundLength)) {
15213
+ requestContentLength = outboundLength;
15214
+ if (outboundLength > maxBodyLength) throw maxBodyLengthError();
14896
15215
  }
14897
15216
  }
15217
+ const mustEnforceStreamBody = hasMaxBodyLength && (utils_default.isReadableStream(data) || utils_default.isStream(data));
15218
+ const trackRequestStream = (stream, onProgress, flush) => trackStream(stream, DEFAULT_CHUNK_SIZE, (loadedBytes) => {
15219
+ if (hasMaxBodyLength && loadedBytes > maxBodyLength) throw pendingBodyError = maxBodyLengthError();
15220
+ onProgress && onProgress(loadedBytes);
15221
+ }, flush);
15222
+ if (supportsRequestStream && method !== "get" && method !== "head" && (onUploadProgress || mustEnforceStreamBody)) {
15223
+ requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
15224
+ if (requestContentLength !== 0 || mustEnforceStreamBody) {
15225
+ let _request = new Request(url, {
15226
+ method: "POST",
15227
+ body: data,
15228
+ duplex: "half"
15229
+ });
15230
+ let contentTypeHeader;
15231
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) headers.setContentType(contentTypeHeader);
15232
+ if (_request.body) {
15233
+ const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [];
15234
+ data = trackRequestStream(_request.body, onProgress, flush);
15235
+ }
15236
+ }
15237
+ } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== "get" && method !== "head") data = trackRequestStream(data);
15238
+ else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== "get" && method !== "head") throw new AxiosError$1("Stream request bodies are not supported by the current fetch implementation", AxiosError$1.ERR_NOT_SUPPORT, config, request);
14898
15239
  if (!utils_default.isString(withCredentials)) withCredentials = withCredentials ? "include" : "omit";
14899
15240
  const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
14900
15241
  if (utils_default.isFormData(data)) {
14901
15242
  const contentType = headers.getContentType();
14902
15243
  if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) headers.delete("content-type");
14903
15244
  }
14904
- headers.set("User-Agent", "axios/" + VERSION$1, false);
15245
+ headers.set("User-Agent", "axios/1.18.1", false);
14905
15246
  const resolvedOptions = {
14906
15247
  ...fetchOptions,
14907
15248
  signal: composedSignal,
@@ -14913,8 +15254,9 @@ const factory = (env) => {
14913
15254
  };
14914
15255
  request = isRequestSupported && new Request(url, resolvedOptions);
14915
15256
  let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
15257
+ const responseHeaders = AxiosHeaders$1.from(response.headers);
14916
15258
  if (hasMaxContentLength) {
14917
- const declaredLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
15259
+ const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
14918
15260
  if (declaredLength != null && declaredLength > maxContentLength) throw new AxiosError$1("maxContentLength size of " + maxContentLength + " exceeded", AxiosError$1.ERR_BAD_RESPONSE, config, request);
14919
15261
  }
14920
15262
  const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
@@ -14927,7 +15269,7 @@ const factory = (env) => {
14927
15269
  ].forEach((prop) => {
14928
15270
  options[prop] = response[prop];
14929
15271
  });
14930
- const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
15272
+ const responseContentLength = utils_default.toFiniteNumber(responseHeaders.getContentLength());
14931
15273
  const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
14932
15274
  let bytesRead = 0;
14933
15275
  const onChunkProgress = (loadedBytes) => {
@@ -14970,10 +15312,34 @@ const factory = (env) => {
14970
15312
  const canceledError = composedSignal.reason;
14971
15313
  canceledError.config = config;
14972
15314
  request && (canceledError.request = request);
14973
- err !== canceledError && (canceledError.cause = err);
15315
+ if (err !== canceledError) Object.defineProperty(canceledError, "cause", {
15316
+ __proto__: null,
15317
+ value: err,
15318
+ writable: true,
15319
+ enumerable: false,
15320
+ configurable: true
15321
+ });
14974
15322
  throw canceledError;
14975
15323
  }
14976
- if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) throw Object.assign(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request, err && err.response), { cause: err.cause || err });
15324
+ if (pendingBodyError) {
15325
+ request && !pendingBodyError.request && (pendingBodyError.request = request);
15326
+ throw pendingBodyError;
15327
+ }
15328
+ if (err instanceof AxiosError$1) {
15329
+ request && !err.request && (err.request = request);
15330
+ throw err;
15331
+ }
15332
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
15333
+ const networkError = new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request, err && err.response);
15334
+ Object.defineProperty(networkError, "cause", {
15335
+ __proto__: null,
15336
+ value: err.cause || err,
15337
+ writable: true,
15338
+ enumerable: false,
15339
+ configurable: true
15340
+ });
15341
+ throw networkError;
15342
+ }
14977
15343
  throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
14978
15344
  }
14979
15345
  };
@@ -14998,7 +15364,7 @@ const getFetch = (config) => {
14998
15364
  };
14999
15365
  getFetch();
15000
15366
  //#endregion
15001
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/adapters/adapters.js
15367
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/adapters/adapters.js
15002
15368
  /**
15003
15369
  * Known adapters mapping.
15004
15370
  * Provides environment-specific adapters for Axios:
@@ -15070,7 +15436,7 @@ function getAdapter$1(adapters, config) {
15070
15436
  }
15071
15437
  if (!adapter) {
15072
15438
  const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
15073
- throw new AxiosError$1(`There is no suitable adapter to dispatch the request ` + (length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT");
15439
+ throw new AxiosError$1(`There is no suitable adapter to dispatch the request ` + (length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"), AxiosError$1.ERR_NOT_SUPPORT);
15074
15440
  }
15075
15441
  return adapter;
15076
15442
  }
@@ -15090,7 +15456,7 @@ var adapters_default = {
15090
15456
  adapters: knownAdapters
15091
15457
  };
15092
15458
  //#endregion
15093
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/dispatchRequest.js
15459
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/dispatchRequest.js
15094
15460
  /**
15095
15461
  * Throws a `CanceledError` if cancellation has been requested.
15096
15462
  *
@@ -15145,7 +15511,7 @@ function dispatchRequest(config) {
15145
15511
  });
15146
15512
  }
15147
15513
  //#endregion
15148
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/validator.js
15514
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/validator.js
15149
15515
  const validators$1 = {};
15150
15516
  [
15151
15517
  "object",
@@ -15171,7 +15537,7 @@ const deprecatedWarnings = {};
15171
15537
  */
15172
15538
  validators$1.transitional = function transitional(validator, version, message) {
15173
15539
  function formatMessage(opt, desc) {
15174
- return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
15540
+ return "[Axios v1.18.1] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
15175
15541
  }
15176
15542
  return (value, opt, opts) => {
15177
15543
  if (validator === false) throw new AxiosError$1(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError$1.ERR_DEPRECATED);
@@ -15198,7 +15564,7 @@ validators$1.spelling = function spelling(correctSpelling) {
15198
15564
  * @returns {object}
15199
15565
  */
15200
15566
  function assertOptions(options, schema, allowUnknown) {
15201
- if (typeof options !== "object") throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
15567
+ if (typeof options !== "object" || options === null) throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
15202
15568
  const keys = Object.keys(options);
15203
15569
  let i = keys.length;
15204
15570
  while (i-- > 0) {
@@ -15218,7 +15584,7 @@ var validator_default = {
15218
15584
  validators: validators$1
15219
15585
  };
15220
15586
  //#endregion
15221
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/core/Axios.js
15587
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/core/Axios.js
15222
15588
  const validators = validator_default.validators;
15223
15589
  /**
15224
15590
  * Create a new instance of Axios
@@ -15279,7 +15645,9 @@ var Axios$1 = class {
15279
15645
  silentJSONParsing: validators.transitional(validators.boolean),
15280
15646
  forcedJSONParsing: validators.transitional(validators.boolean),
15281
15647
  clarifyTimeoutError: validators.transitional(validators.boolean),
15282
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
15648
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
15649
+ advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
15650
+ validateStatusUndefinedResolves: validators.transitional(validators.boolean)
15283
15651
  }, false);
15284
15652
  if (paramsSerializer != null) if (utils_default.isFunction(paramsSerializer)) config.paramsSerializer = { serialize: paramsSerializer };
15285
15653
  else validator_default.assertOptions(paramsSerializer, {
@@ -15356,7 +15724,7 @@ var Axios$1 = class {
15356
15724
  }
15357
15725
  getUri(config) {
15358
15726
  config = mergeConfig$1(this.defaults, config);
15359
- return buildURL(buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls), config.params, config.paramsSerializer);
15727
+ return buildURL(buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config), config.params, config.paramsSerializer);
15360
15728
  }
15361
15729
  };
15362
15730
  utils_default.forEach([
@@ -15369,7 +15737,7 @@ utils_default.forEach([
15369
15737
  return this.request(mergeConfig$1(config || {}, {
15370
15738
  method,
15371
15739
  url,
15372
- data: (config || {}).data
15740
+ data: config && utils_default.hasOwnProp(config, "data") ? config.data : void 0
15373
15741
  }));
15374
15742
  };
15375
15743
  });
@@ -15393,7 +15761,7 @@ utils_default.forEach([
15393
15761
  if (method !== "query") Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
15394
15762
  });
15395
15763
  //#endregion
15396
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/cancel/CancelToken.js
15764
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/cancel/CancelToken.js
15397
15765
  /**
15398
15766
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
15399
15767
  *
@@ -15481,7 +15849,7 @@ var CancelToken$1 = class CancelToken$1 {
15481
15849
  }
15482
15850
  };
15483
15851
  //#endregion
15484
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/spread.js
15852
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/spread.js
15485
15853
  /**
15486
15854
  * Syntactic sugar for invoking a function and expanding an array for arguments.
15487
15855
  *
@@ -15509,7 +15877,7 @@ function spread$1(callback) {
15509
15877
  };
15510
15878
  }
15511
15879
  //#endregion
15512
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/isAxiosError.js
15880
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/isAxiosError.js
15513
15881
  /**
15514
15882
  * Determines whether the payload is an error thrown by Axios
15515
15883
  *
@@ -15521,7 +15889,7 @@ function isAxiosError$1(payload) {
15521
15889
  return utils_default.isObject(payload) && payload.isAxiosError === true;
15522
15890
  }
15523
15891
  //#endregion
15524
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/HttpStatusCode.js
15892
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/helpers/HttpStatusCode.js
15525
15893
  const HttpStatusCode$1 = {
15526
15894
  Continue: 100,
15527
15895
  SwitchingProtocols: 101,
@@ -15597,7 +15965,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
15597
15965
  HttpStatusCode$1[value] = key;
15598
15966
  });
15599
15967
  //#endregion
15600
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/axios.js
15968
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/lib/axios.js
15601
15969
  /**
15602
15970
  * Create an instance of Axios
15603
15971
  *
@@ -15636,7 +16004,7 @@ axios.getAdapter = adapters_default.getAdapter;
15636
16004
  axios.HttpStatusCode = HttpStatusCode$1;
15637
16005
  axios.default = axios;
15638
16006
  //#endregion
15639
- //#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/index.js
16007
+ //#region node_modules/.pnpm/axios@1.18.1/node_modules/axios/index.js
15640
16008
  const { Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig, create } = axios;
15641
16009
  //#endregion
15642
16010
  //#region src/error.ts
@@ -15709,7 +16077,10 @@ function createDocboxRoutes(options) {
15709
16077
  if (scope === void 0 || typeof scope !== "string") return (0, import_lib.badRequest)("scope must be defined and a string");
15710
16078
  const path = request.path.substring(basePath.length);
15711
16079
  if (!await options.isAllowedWrite(request, scope, path)) return (0, import_lib.forbidden)("you don't have permission to access this resource");
15712
- return forwardRequest(axiosInstance, request, await options.getRequestTenant(request), await getRequestUser(request), await getApiKey(), h, path);
16080
+ const tenant = await options.getRequestTenant(request);
16081
+ const user = await getRequestUser(request);
16082
+ const apiKey = await getApiKey();
16083
+ return forwardRequest(axiosInstance, request, tenant, user, apiKey, h, path);
15713
16084
  },
15714
16085
  options: baseRouteOptions
15715
16086
  },
@@ -15721,7 +16092,10 @@ function createDocboxRoutes(options) {
15721
16092
  if (scope === void 0 || typeof scope !== "string") return (0, import_lib.badRequest)("scope must be defined and a string");
15722
16093
  const path = request.path.substring(basePath.length);
15723
16094
  if (!await options.isAllowedRead(request, scope, path)) return (0, import_lib.forbidden)("you don't have permission to access this resource");
15724
- return forwardRequest(axiosInstance, request, await options.getRequestTenant(request), await getRequestUser(request), await getApiKey(), h, path);
16095
+ const tenant = await options.getRequestTenant(request);
16096
+ const user = await getRequestUser(request);
16097
+ const apiKey = await getApiKey();
16098
+ return forwardRequest(axiosInstance, request, tenant, user, apiKey, h, path);
15725
16099
  },
15726
16100
  options: {
15727
16101
  ...baseRouteOptions,
@@ -15741,7 +16115,10 @@ function createDocboxRoutes(options) {
15741
16115
  if (scope === void 0 || typeof scope !== "string") return (0, import_lib.badRequest)("scope must be defined and a string");
15742
16116
  const path = request.path.substring(basePath.length);
15743
16117
  if (!await (isWriteRequest(request, path) ? options.isAllowedWrite : options.isAllowedRead)(request, scope, path)) return (0, import_lib.forbidden)("you don't have permission to access this resource");
15744
- return forwardRequest(axiosInstance, request, await options.getRequestTenant(request), await getRequestUser(request), await getApiKey(), h, path);
16118
+ const tenant = await options.getRequestTenant(request);
16119
+ const user = await getRequestUser(request);
16120
+ const apiKey = await getApiKey();
16121
+ return forwardRequest(axiosInstance, request, tenant, user, apiKey, h, path);
15745
16122
  },
15746
16123
  options: {
15747
16124
  ...baseRouteOptions,