@bitrix24/b24jssdk 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README-AI.md +12 -0
  2. package/dist/esm/_virtual/_commonjsHelpers.mjs +1 -1
  3. package/dist/esm/_virtual/protobuf.mjs +1 -1
  4. package/dist/esm/_virtual/protobuf2.mjs +1 -1
  5. package/dist/esm/core/abstract-b24.mjs +1 -1
  6. package/dist/esm/core/actions/abstract-action.mjs +1 -1
  7. package/dist/esm/core/actions/abstract-batch.mjs +1 -1
  8. package/dist/esm/core/actions/manager.mjs +1 -1
  9. package/dist/esm/core/actions/v2/batch-by-chunk.mjs +1 -1
  10. package/dist/esm/core/actions/v2/batch.mjs +4 -4
  11. package/dist/esm/core/actions/v2/batch.mjs.map +1 -1
  12. package/dist/esm/core/actions/v2/call-list.mjs +1 -1
  13. package/dist/esm/core/actions/v2/call.mjs +1 -1
  14. package/dist/esm/core/actions/v2/fetch-list.mjs +1 -1
  15. package/dist/esm/core/actions/v2/manager-v2.mjs +1 -1
  16. package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
  17. package/dist/esm/core/actions/v3/batch.mjs +4 -4
  18. package/dist/esm/core/actions/v3/batch.mjs.map +1 -1
  19. package/dist/esm/core/actions/v3/call-list.mjs +1 -1
  20. package/dist/esm/core/actions/v3/call.mjs +1 -1
  21. package/dist/esm/core/actions/v3/fetch-list.mjs +1 -1
  22. package/dist/esm/core/actions/v3/manager-v3.mjs +1 -1
  23. package/dist/esm/core/http/abstract-http.mjs +9 -13
  24. package/dist/esm/core/http/abstract-http.mjs.map +1 -1
  25. package/dist/esm/core/http/ajax-error.mjs +9 -5
  26. package/dist/esm/core/http/ajax-error.mjs.map +1 -1
  27. package/dist/esm/core/http/ajax-result.mjs +1 -1
  28. package/dist/esm/core/http/limiters/adaptive-delayer.mjs +1 -1
  29. package/dist/esm/core/http/limiters/manager.mjs +30 -1
  30. package/dist/esm/core/http/limiters/manager.mjs.map +1 -1
  31. package/dist/esm/core/http/limiters/operating-limiter.mjs +1 -1
  32. package/dist/esm/core/http/limiters/params-factory.mjs +1 -1
  33. package/dist/esm/core/http/limiters/rate-limiter.mjs +1 -1
  34. package/dist/esm/core/http/redact.mjs +52 -0
  35. package/dist/esm/core/http/redact.mjs.map +1 -0
  36. package/dist/esm/core/http/v2.mjs +2 -2
  37. package/dist/esm/core/http/v3.mjs +2 -2
  38. package/dist/esm/core/interaction/batch/abstract-interaction-batch.mjs +1 -1
  39. package/dist/esm/core/interaction/batch/parse-row.mjs +1 -1
  40. package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs +1 -1
  41. package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +1 -1
  42. package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs +1 -1
  43. package/dist/esm/core/interaction/batch/processing/v2/as-object.mjs +1 -1
  44. package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs +1 -1
  45. package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs +1 -1
  46. package/dist/esm/core/interaction/batch/processing/v3/as-object.mjs +1 -1
  47. package/dist/esm/core/interaction/batch/v2.mjs +1 -1
  48. package/dist/esm/core/interaction/batch/v3.mjs +1 -1
  49. package/dist/esm/core/language/list.mjs +1 -1
  50. package/dist/esm/core/request-id-generator.mjs +1 -1
  51. package/dist/esm/core/result.mjs +1 -1
  52. package/dist/esm/core/sdk-error.mjs +1 -1
  53. package/dist/esm/core/tools/abstract-tool.mjs +1 -1
  54. package/dist/esm/core/tools/healthcheck.mjs +1 -1
  55. package/dist/esm/core/tools/manager.mjs +1 -1
  56. package/dist/esm/core/tools/ping.mjs +1 -1
  57. package/dist/esm/core/version-manager.mjs +1 -1
  58. package/dist/esm/frame/auth.mjs +1 -1
  59. package/dist/esm/frame/b24.mjs +1 -1
  60. package/dist/esm/frame/dialog.mjs +1 -1
  61. package/dist/esm/frame/frame.mjs +1 -1
  62. package/dist/esm/frame/message/commands.mjs +1 -1
  63. package/dist/esm/frame/message/controller.mjs +1 -1
  64. package/dist/esm/frame/options.mjs +1 -1
  65. package/dist/esm/frame/parent.mjs +1 -1
  66. package/dist/esm/frame/placement.mjs +1 -1
  67. package/dist/esm/frame/slider.mjs +1 -1
  68. package/dist/esm/helper/abstract-helper.mjs +1 -1
  69. package/dist/esm/helper/app-manager.mjs +1 -1
  70. package/dist/esm/helper/currency-manager.mjs +1 -1
  71. package/dist/esm/helper/helper-manager.mjs +1 -1
  72. package/dist/esm/helper/license-manager.mjs +1 -1
  73. package/dist/esm/helper/options-manager.mjs +1 -1
  74. package/dist/esm/helper/payment-manager.mjs +1 -1
  75. package/dist/esm/helper/profile-manager.mjs +1 -1
  76. package/dist/esm/helper/use-b24-helper.mjs +1 -1
  77. package/dist/esm/hook/auth.mjs +1 -1
  78. package/dist/esm/hook/b24.mjs +1 -1
  79. package/dist/esm/index.d.mts +9 -13
  80. package/dist/esm/index.d.ts +9 -13
  81. package/dist/esm/index.mjs +1 -1
  82. package/dist/esm/loader-b24frame.mjs +1 -1
  83. package/dist/esm/logger/abstract-logger.mjs +1 -1
  84. package/dist/esm/logger/browser.mjs +1 -1
  85. package/dist/esm/logger/formatter/abstract-formatter.mjs +1 -1
  86. package/dist/esm/logger/formatter/json-formatter.mjs +1 -1
  87. package/dist/esm/logger/formatter/line-formatter.mjs +1 -1
  88. package/dist/esm/logger/formatter/telegram-formatter.mjs +1 -1
  89. package/dist/esm/logger/handler/abstract-handler.mjs +1 -1
  90. package/dist/esm/logger/handler/consola-adapter.mjs +1 -1
  91. package/dist/esm/logger/handler/console-handler.mjs +1 -1
  92. package/dist/esm/logger/handler/console-v2-handler.mjs +1 -1
  93. package/dist/esm/logger/handler/memory-handler.mjs +1 -1
  94. package/dist/esm/logger/handler/stream-handler.mjs +1 -1
  95. package/dist/esm/logger/handler/telegram-handler.mjs +1 -1
  96. package/dist/esm/logger/handler/winston-adapter.mjs +1 -1
  97. package/dist/esm/logger/logger-factory.mjs +1 -1
  98. package/dist/esm/logger/logger.mjs +1 -1
  99. package/dist/esm/logger/null-logger.mjs +1 -1
  100. package/dist/esm/logger/processor/memory-usage-processor.mjs +1 -1
  101. package/dist/esm/logger/processor/pid-processor.mjs +1 -1
  102. package/dist/esm/oauth/auth.mjs +1 -1
  103. package/dist/esm/oauth/b24.mjs +1 -1
  104. package/dist/esm/oauth/refresh-token-error.mjs +1 -1
  105. package/dist/esm/pullClient/abstract-connector.mjs +1 -1
  106. package/dist/esm/pullClient/channel-manager.mjs +1 -1
  107. package/dist/esm/pullClient/client.mjs +1 -1
  108. package/dist/esm/pullClient/errors.mjs +1 -1
  109. package/dist/esm/pullClient/json-rpc.mjs +1 -1
  110. package/dist/esm/pullClient/long-polling-connector.mjs +1 -1
  111. package/dist/esm/pullClient/protobuf/index.mjs +1 -1
  112. package/dist/esm/pullClient/protobuf/model.mjs +1 -1
  113. package/dist/esm/pullClient/protobuf/protobuf.mjs +53 -53
  114. package/dist/esm/pullClient/protobuf/protobuf.mjs.map +1 -1
  115. package/dist/esm/pullClient/shared-config.mjs +1 -1
  116. package/dist/esm/pullClient/storage-manager.mjs +1 -1
  117. package/dist/esm/pullClient/web-socket-connector.mjs +1 -1
  118. package/dist/esm/tools/browser.mjs +1 -1
  119. package/dist/esm/tools/environment.mjs +1 -1
  120. package/dist/esm/tools/formatters/iban.mjs +1 -1
  121. package/dist/esm/tools/formatters/numbers.mjs +1 -1
  122. package/dist/esm/tools/index.mjs +1 -1
  123. package/dist/esm/tools/scroll-size.mjs +1 -1
  124. package/dist/esm/tools/text.mjs +1 -1
  125. package/dist/esm/tools/type.mjs +1 -1
  126. package/dist/esm/tools/use-formatters.mjs +1 -1
  127. package/dist/esm/tools/uuidv7.mjs +1 -1
  128. package/dist/esm/types/b24-helper.mjs +1 -1
  129. package/dist/esm/types/b24.mjs +1 -1
  130. package/dist/esm/types/bizproc/index.mjs +1 -1
  131. package/dist/esm/types/catalog/index.mjs +1 -1
  132. package/dist/esm/types/common.mjs +1 -1
  133. package/dist/esm/types/crm/entity-type.mjs +1 -1
  134. package/dist/esm/types/crm/productrow.mjs +1 -1
  135. package/dist/esm/types/logger.mjs +1 -1
  136. package/dist/esm/types/pull.mjs +1 -1
  137. package/dist/umd/index.js +1822 -1357
  138. package/dist/umd/index.js.map +1 -1
  139. package/dist/umd/index.min.js +30 -30
  140. package/dist/umd/index.min.js.map +1 -1
  141. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @package @bitrix24/b24jssdk
3
- * @version 1.1.1
3
+ * @version 1.2.0
4
4
  * @copyright (c) 2026 Bitrix24
5
5
  * @license MIT
6
6
  * @see https://github.com/bitrix24/b24jssdk
@@ -8153,11 +8153,11 @@
8153
8153
  }
8154
8154
  }
8155
8155
 
8156
- var __defProp$1J = Object.defineProperty;
8157
- var __name$1J = (target, value) => __defProp$1J(target, "name", { value, configurable: true });
8156
+ var __defProp$1K = Object.defineProperty;
8157
+ var __name$1K = (target, value) => __defProp$1K(target, "name", { value, configurable: true });
8158
8158
  class AbstractFormatter {
8159
8159
  static {
8160
- __name$1J(this, "AbstractFormatter");
8160
+ __name$1K(this, "AbstractFormatter");
8161
8161
  }
8162
8162
  dateFormat;
8163
8163
  constructor(dateFormat = "YYYY-MM-DD HH:mm:ss") {
@@ -8175,11 +8175,11 @@
8175
8175
  }
8176
8176
  }
8177
8177
 
8178
- var __defProp$1I = Object.defineProperty;
8179
- var __name$1I = (target, value) => __defProp$1I(target, "name", { value, configurable: true });
8178
+ var __defProp$1J = Object.defineProperty;
8179
+ var __name$1J = (target, value) => __defProp$1J(target, "name", { value, configurable: true });
8180
8180
  class JsonFormatter extends AbstractFormatter {
8181
8181
  static {
8182
- __name$1I(this, "JsonFormatter");
8182
+ __name$1J(this, "JsonFormatter");
8183
8183
  }
8184
8184
  constructor(dateFormat = "YYYY-MM-DD HH:mm:ss") {
8185
8185
  super(dateFormat);
@@ -8197,11 +8197,11 @@
8197
8197
  }
8198
8198
  }
8199
8199
 
8200
- var __defProp$1H = Object.defineProperty;
8201
- var __name$1H = (target, value) => __defProp$1H(target, "name", { value, configurable: true });
8200
+ var __defProp$1I = Object.defineProperty;
8201
+ var __name$1I = (target, value) => __defProp$1I(target, "name", { value, configurable: true });
8202
8202
  class LineFormatter extends AbstractFormatter {
8203
8203
  static {
8204
- __name$1H(this, "LineFormatter");
8204
+ __name$1I(this, "LineFormatter");
8205
8205
  }
8206
8206
  formatString;
8207
8207
  constructor(formatString = "[{channel}] {levelName}: {message} {context} {extra} {date}", dateFormat = "YYYY-MM-DD HH:mm:ss") {
@@ -8226,11 +8226,11 @@
8226
8226
  }
8227
8227
  }
8228
8228
 
8229
- var __defProp$1G = Object.defineProperty;
8230
- var __name$1G = (target, value) => __defProp$1G(target, "name", { value, configurable: true });
8229
+ var __defProp$1H = Object.defineProperty;
8230
+ var __name$1H = (target, value) => __defProp$1H(target, "name", { value, configurable: true });
8231
8231
  class TelegramFormatter extends AbstractFormatter {
8232
8232
  static {
8233
- __name$1G(this, "TelegramFormatter");
8233
+ __name$1H(this, "TelegramFormatter");
8234
8234
  }
8235
8235
  useHtml;
8236
8236
  maxMessageLength;
@@ -8317,9 +8317,9 @@ ${extraStr}
8317
8317
  }
8318
8318
  }
8319
8319
 
8320
- var __defProp$1F = Object.defineProperty;
8321
- var __name$1F = (target, value) => __defProp$1F(target, "name", { value, configurable: true });
8322
- const pidProcessor = /* @__PURE__ */ __name$1F((record) => {
8320
+ var __defProp$1G = Object.defineProperty;
8321
+ var __name$1G = (target, value) => __defProp$1G(target, "name", { value, configurable: true });
8322
+ const pidProcessor = /* @__PURE__ */ __name$1G((record) => {
8323
8323
  record.extra["pid"] = "?";
8324
8324
  if (typeof process !== "undefined" && process.pid) {
8325
8325
  record.extra["pid"] = process.pid;
@@ -8327,9 +8327,9 @@ ${extraStr}
8327
8327
  return record;
8328
8328
  }, "pidProcessor");
8329
8329
 
8330
- var __defProp$1E = Object.defineProperty;
8331
- var __name$1E = (target, value) => __defProp$1E(target, "name", { value, configurable: true });
8332
- const memoryUsageProcessor = /* @__PURE__ */ __name$1E((record) => {
8330
+ var __defProp$1F = Object.defineProperty;
8331
+ var __name$1F = (target, value) => __defProp$1F(target, "name", { value, configurable: true });
8332
+ const memoryUsageProcessor = /* @__PURE__ */ __name$1F((record) => {
8333
8333
  record.extra["memoryUsage"] = "?";
8334
8334
  if (typeof process !== "undefined" && process.memoryUsage) {
8335
8335
  record.extra["memoryUsage"] = Math.round(process.memoryUsage().heapUsed / 1024 / 1024) + "MB";
@@ -8337,11 +8337,11 @@ ${extraStr}
8337
8337
  return record;
8338
8338
  }, "memoryUsageProcessor");
8339
8339
 
8340
- var __defProp$1D = Object.defineProperty;
8341
- var __name$1D = (target, value) => __defProp$1D(target, "name", { value, configurable: true });
8340
+ var __defProp$1E = Object.defineProperty;
8341
+ var __name$1E = (target, value) => __defProp$1E(target, "name", { value, configurable: true });
8342
8342
  class AbstractHandler {
8343
8343
  static {
8344
- __name$1D(this, "AbstractHandler");
8344
+ __name$1E(this, "AbstractHandler");
8345
8345
  }
8346
8346
  level;
8347
8347
  formatter = null;
@@ -8364,11 +8364,11 @@ ${extraStr}
8364
8364
  }
8365
8365
  }
8366
8366
 
8367
- var __defProp$1C = Object.defineProperty;
8368
- var __name$1C = (target, value) => __defProp$1C(target, "name", { value, configurable: true });
8367
+ var __defProp$1D = Object.defineProperty;
8368
+ var __name$1D = (target, value) => __defProp$1D(target, "name", { value, configurable: true });
8369
8369
  class ConsoleHandler extends AbstractHandler {
8370
8370
  static {
8371
- __name$1C(this, "ConsoleHandler");
8371
+ __name$1D(this, "ConsoleHandler");
8372
8372
  }
8373
8373
  _styles = /* @__PURE__ */ new Map();
8374
8374
  _useStyles;
@@ -8448,11 +8448,11 @@ ${extraStr}
8448
8448
  }
8449
8449
  }
8450
8450
 
8451
- var __defProp$1B = Object.defineProperty;
8452
- var __name$1B = (target, value) => __defProp$1B(target, "name", { value, configurable: true });
8451
+ var __defProp$1C = Object.defineProperty;
8452
+ var __name$1C = (target, value) => __defProp$1C(target, "name", { value, configurable: true });
8453
8453
  class ConsoleV2Handler extends ConsoleHandler {
8454
8454
  static {
8455
- __name$1B(this, "ConsoleV2Handler");
8455
+ __name$1C(this, "ConsoleV2Handler");
8456
8456
  }
8457
8457
  constructor(level = LogLevel.DEBUG, options) {
8458
8458
  super(level, options);
@@ -8485,11 +8485,11 @@ ${extraStr}
8485
8485
  }
8486
8486
  }
8487
8487
 
8488
- var __defProp$1A = Object.defineProperty;
8489
- var __name$1A = (target, value) => __defProp$1A(target, "name", { value, configurable: true });
8488
+ var __defProp$1B = Object.defineProperty;
8489
+ var __name$1B = (target, value) => __defProp$1B(target, "name", { value, configurable: true });
8490
8490
  class MemoryHandler extends AbstractHandler {
8491
8491
  static {
8492
- __name$1A(this, "MemoryHandler");
8492
+ __name$1B(this, "MemoryHandler");
8493
8493
  }
8494
8494
  records = [];
8495
8495
  limit;
@@ -8520,11 +8520,11 @@ ${extraStr}
8520
8520
  }
8521
8521
  }
8522
8522
 
8523
- var __defProp$1z = Object.defineProperty;
8524
- var __name$1z = (target, value) => __defProp$1z(target, "name", { value, configurable: true });
8523
+ var __defProp$1A = Object.defineProperty;
8524
+ var __name$1A = (target, value) => __defProp$1A(target, "name", { value, configurable: true });
8525
8525
  class StreamHandler extends AbstractHandler {
8526
8526
  static {
8527
- __name$1z(this, "StreamHandler");
8527
+ __name$1A(this, "StreamHandler");
8528
8528
  }
8529
8529
  /**
8530
8530
  * Stream for writing logs.
@@ -8579,11 +8579,11 @@ ${extraStr}
8579
8579
  }
8580
8580
  }
8581
8581
 
8582
- var __defProp$1y = Object.defineProperty;
8583
- var __name$1y = (target, value) => __defProp$1y(target, "name", { value, configurable: true });
8582
+ var __defProp$1z = Object.defineProperty;
8583
+ var __name$1z = (target, value) => __defProp$1z(target, "name", { value, configurable: true });
8584
8584
  class ConsolaAdapter extends AbstractHandler {
8585
8585
  static {
8586
- __name$1y(this, "ConsolaAdapter");
8586
+ __name$1z(this, "ConsolaAdapter");
8587
8587
  }
8588
8588
  consolaInstance;
8589
8589
  constructor(level = LogLevel.DEBUG, options) {
@@ -8628,11 +8628,11 @@ ${extraStr}
8628
8628
  }
8629
8629
  }
8630
8630
 
8631
- var __defProp$1x = Object.defineProperty;
8632
- var __name$1x = (target, value) => __defProp$1x(target, "name", { value, configurable: true });
8631
+ var __defProp$1y = Object.defineProperty;
8632
+ var __name$1y = (target, value) => __defProp$1y(target, "name", { value, configurable: true });
8633
8633
  class WinstonAdapter extends AbstractHandler {
8634
8634
  static {
8635
- __name$1x(this, "WinstonAdapter");
8635
+ __name$1y(this, "WinstonAdapter");
8636
8636
  }
8637
8637
  winstonLogger;
8638
8638
  constructor(level = LogLevel.DEBUG, options) {
@@ -8672,8 +8672,8 @@ ${extraStr}
8672
8672
  }
8673
8673
  }
8674
8674
 
8675
- var __defProp$1w = Object.defineProperty;
8676
- var __name$1w = (target, value) => __defProp$1w(target, "name", { value, configurable: true });
8675
+ var __defProp$1x = Object.defineProperty;
8676
+ var __name$1x = (target, value) => __defProp$1x(target, "name", { value, configurable: true });
8677
8677
  var Environment = /* @__PURE__ */ ((Environment2) => {
8678
8678
  Environment2["UNKNOWN"] = "unknown";
8679
8679
  Environment2["BROWSE"] = "browser";
@@ -8689,13 +8689,13 @@ ${extraStr}
8689
8689
  }
8690
8690
  return "unknown" /* UNKNOWN */;
8691
8691
  }
8692
- __name$1w(getEnvironment, "getEnvironment");
8692
+ __name$1x(getEnvironment, "getEnvironment");
8693
8693
 
8694
- var __defProp$1v = Object.defineProperty;
8695
- var __name$1v = (target, value) => __defProp$1v(target, "name", { value, configurable: true });
8694
+ var __defProp$1w = Object.defineProperty;
8695
+ var __name$1w = (target, value) => __defProp$1w(target, "name", { value, configurable: true });
8696
8696
  class TelegramHandler extends AbstractHandler {
8697
8697
  static {
8698
- __name$1v(this, "TelegramHandler");
8698
+ __name$1w(this, "TelegramHandler");
8699
8699
  }
8700
8700
  botToken;
8701
8701
  chatId;
@@ -8833,11 +8833,11 @@ If you need to send logs from browser, use a proxy server.`;
8833
8833
  }
8834
8834
  }
8835
8835
 
8836
- var __defProp$1u = Object.defineProperty;
8837
- var __name$1u = (target, value) => __defProp$1u(target, "name", { value, configurable: true });
8836
+ var __defProp$1v = Object.defineProperty;
8837
+ var __name$1v = (target, value) => __defProp$1v(target, "name", { value, configurable: true });
8838
8838
  class AbstractLogger {
8839
8839
  static {
8840
- __name$1u(this, "AbstractLogger");
8840
+ __name$1v(this, "AbstractLogger");
8841
8841
  }
8842
8842
  /**
8843
8843
  * @inheritDoc
@@ -8890,11 +8890,11 @@ If you need to send logs from browser, use a proxy server.`;
8890
8890
  // endregion ////
8891
8891
  }
8892
8892
 
8893
- var __defProp$1t = Object.defineProperty;
8894
- var __name$1t = (target, value) => __defProp$1t(target, "name", { value, configurable: true });
8893
+ var __defProp$1u = Object.defineProperty;
8894
+ var __name$1u = (target, value) => __defProp$1u(target, "name", { value, configurable: true });
8895
8895
  class NullLogger extends AbstractLogger {
8896
8896
  static {
8897
- __name$1t(this, "NullLogger");
8897
+ __name$1u(this, "NullLogger");
8898
8898
  }
8899
8899
  // region static methods for creation ////
8900
8900
  static create() {
@@ -8910,11 +8910,11 @@ If you need to send logs from browser, use a proxy server.`;
8910
8910
  // endregion ////
8911
8911
  }
8912
8912
 
8913
- var __defProp$1s = Object.defineProperty;
8914
- var __name$1s = (target, value) => __defProp$1s(target, "name", { value, configurable: true });
8913
+ var __defProp$1t = Object.defineProperty;
8914
+ var __name$1t = (target, value) => __defProp$1t(target, "name", { value, configurable: true });
8915
8915
  class Logger extends AbstractLogger {
8916
8916
  static {
8917
- __name$1s(this, "Logger");
8917
+ __name$1t(this, "Logger");
8918
8918
  }
8919
8919
  channel;
8920
8920
  handlers = [];
@@ -8973,11 +8973,11 @@ If you need to send logs from browser, use a proxy server.`;
8973
8973
  }
8974
8974
  }
8975
8975
 
8976
- var __defProp$1r = Object.defineProperty;
8977
- var __name$1r = (target, value) => __defProp$1r(target, "name", { value, configurable: true });
8976
+ var __defProp$1s = Object.defineProperty;
8977
+ var __name$1s = (target, value) => __defProp$1s(target, "name", { value, configurable: true });
8978
8978
  class LoggerFactory {
8979
8979
  static {
8980
- __name$1r(this, "LoggerFactory");
8980
+ __name$1s(this, "LoggerFactory");
8981
8981
  }
8982
8982
  static createNullLogger() {
8983
8983
  return NullLogger.create();
@@ -9025,8 +9025,8 @@ If you need to send logs from browser, use a proxy server.`;
9025
9025
  }
9026
9026
  }
9027
9027
 
9028
- var __defProp$1q = Object.defineProperty;
9029
- var __name$1q = (target, value) => __defProp$1q(target, "name", { value, configurable: true });
9028
+ var __defProp$1r = Object.defineProperty;
9029
+ var __name$1r = (target, value) => __defProp$1r(target, "name", { value, configurable: true });
9030
9030
  const deprecateMessage = "@deprecate: use Logger. https://bitrix24.github.io/b24jssdk/docs/working-with-the-rest-api/logger/";
9031
9031
  var LoggerType = /* @__PURE__ */ ((LoggerType2) => {
9032
9032
  LoggerType2["desktop"] = "desktop";
@@ -9039,7 +9039,7 @@ If you need to send logs from browser, use a proxy server.`;
9039
9039
  })(LoggerType || {});
9040
9040
  class LoggerBrowser {
9041
9041
  static {
9042
- __name$1q(this, "LoggerBrowser");
9042
+ __name$1r(this, "LoggerBrowser");
9043
9043
  }
9044
9044
  #logger;
9045
9045
  /**
@@ -9196,12 +9196,12 @@ If you need to send logs from browser, use a proxy server.`;
9196
9196
  return DataType2;
9197
9197
  })(DataType || {});
9198
9198
 
9199
- var __defProp$1p = Object.defineProperty;
9200
- var __name$1p = (target, value) => __defProp$1p(target, "name", { value, configurable: true });
9199
+ var __defProp$1q = Object.defineProperty;
9200
+ var __name$1q = (target, value) => __defProp$1q(target, "name", { value, configurable: true });
9201
9201
  const OBJECT_CONSTRUCTOR_STRING = Function.prototype.toString.call(Object);
9202
9202
  class TypeManager {
9203
9203
  static {
9204
- __name$1p(this, "TypeManager");
9204
+ __name$1q(this, "TypeManager");
9205
9205
  }
9206
9206
  getTag(value) {
9207
9207
  return Object.prototype.toString.call(value);
@@ -9523,8 +9523,8 @@ If you need to send logs from browser, use a proxy server.`;
9523
9523
  }
9524
9524
  const Type = new TypeManager();
9525
9525
 
9526
- var __defProp$1o = Object.defineProperty;
9527
- var __name$1o = (target, value) => __defProp$1o(target, "name", { value, configurable: true });
9526
+ var __defProp$1p = Object.defineProperty;
9527
+ var __name$1p = (target, value) => __defProp$1p(target, "name", { value, configurable: true });
9528
9528
  function pick(data, keys) {
9529
9529
  const result = {};
9530
9530
  for (const key of keys) {
@@ -9532,7 +9532,7 @@ If you need to send logs from browser, use a proxy server.`;
9532
9532
  }
9533
9533
  return result;
9534
9534
  }
9535
- __name$1o(pick, "pick");
9535
+ __name$1p(pick, "pick");
9536
9536
  function omit(data, keys) {
9537
9537
  const result = { ...data };
9538
9538
  for (const key of keys) {
@@ -9540,18 +9540,18 @@ If you need to send logs from browser, use a proxy server.`;
9540
9540
  }
9541
9541
  return result;
9542
9542
  }
9543
- __name$1o(omit, "omit");
9543
+ __name$1p(omit, "omit");
9544
9544
  function isArrayOfArray(item) {
9545
9545
  return Array.isArray(item[0]);
9546
9546
  }
9547
- __name$1o(isArrayOfArray, "isArrayOfArray");
9547
+ __name$1p(isArrayOfArray, "isArrayOfArray");
9548
9548
  function getEnumValue(enumObj, value) {
9549
9549
  return Object.values(enumObj).includes(value) ? value : void 0;
9550
9550
  }
9551
- __name$1o(getEnumValue, "getEnumValue");
9551
+ __name$1p(getEnumValue, "getEnumValue");
9552
9552
 
9553
- var __defProp$1n = Object.defineProperty;
9554
- var __name$1n = (target, value) => __defProp$1n(target, "name", { value, configurable: true });
9553
+ var __defProp$1o = Object.defineProperty;
9554
+ var __name$1o = (target, value) => __defProp$1o(target, "name", { value, configurable: true });
9555
9555
  const byteToHex = [];
9556
9556
  for (let i = 0; i < 256; ++i) {
9557
9557
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -9570,7 +9570,7 @@ If you need to send logs from browser, use a proxy server.`;
9570
9570
  return t >>> 0;
9571
9571
  };
9572
9572
  }
9573
- __name$1n(sfc32, "sfc32");
9573
+ __name$1o(sfc32, "sfc32");
9574
9574
  function uuidv7() {
9575
9575
  const bytes = new Uint8Array(16);
9576
9576
  const timestamp = BigInt(Date.now());
@@ -9592,10 +9592,10 @@ If you need to send logs from browser, use a proxy server.`;
9592
9592
  bytes[8] = 128 | bytes[8] & 63;
9593
9593
  return (byteToHex[bytes[0]] + byteToHex[bytes[1]] + byteToHex[bytes[2]] + byteToHex[bytes[3]] + "-" + byteToHex[bytes[4]] + byteToHex[bytes[5]] + "-" + byteToHex[bytes[6]] + byteToHex[bytes[7]] + "-" + byteToHex[bytes[8]] + byteToHex[bytes[9]] + "-" + byteToHex[bytes[10]] + byteToHex[bytes[11]] + byteToHex[bytes[12]] + byteToHex[bytes[13]] + byteToHex[bytes[14]] + byteToHex[bytes[15]]).toLowerCase();
9594
9594
  }
9595
- __name$1n(uuidv7, "uuidv7");
9595
+ __name$1o(uuidv7, "uuidv7");
9596
9596
 
9597
- var __defProp$1m = Object.defineProperty;
9598
- var __name$1m = (target, value) => __defProp$1m(target, "name", { value, configurable: true });
9597
+ var __defProp$1n = Object.defineProperty;
9598
+ var __name$1n = (target, value) => __defProp$1n(target, "name", { value, configurable: true });
9599
9599
  const reEscape = /[&<>'"]/g;
9600
9600
  const reUnescape = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34)/g;
9601
9601
  const escapeEntities = {
@@ -9619,7 +9619,7 @@ If you need to send logs from browser, use a proxy server.`;
9619
9619
  };
9620
9620
  class TextManager {
9621
9621
  static {
9622
- __name$1m(this, "TextManager");
9622
+ __name$1n(this, "TextManager");
9623
9623
  }
9624
9624
  getRandom(length = 8) {
9625
9625
  return [...Array(length)].map(() => Math.trunc(Math.random() * 36).toString(36)).join("");
@@ -9719,7 +9719,7 @@ If you need to send logs from browser, use a proxy server.`;
9719
9719
  numberFormat(number, decimals = 0, decPoint = ".", thousandsSep = ",") {
9720
9720
  const n = !Number.isFinite(number) ? 0 : number;
9721
9721
  const fractionDigits = !Number.isFinite(decimals) ? 0 : Math.abs(decimals);
9722
- const toFixedFix = /* @__PURE__ */ __name$1m((n2, fractionDigits2) => {
9722
+ const toFixedFix = /* @__PURE__ */ __name$1n((n2, fractionDigits2) => {
9723
9723
  const k = Math.pow(10, fractionDigits2);
9724
9724
  return Math.round(n2 * k) / k;
9725
9725
  }, "toFixedFix");
@@ -9788,8 +9788,8 @@ If you need to send logs from browser, use a proxy server.`;
9788
9788
  }
9789
9789
  const Text = new TextManager();
9790
9790
 
9791
- var __defProp$1l = Object.defineProperty;
9792
- var __name$1l = (target, value) => __defProp$1l(target, "name", { value, configurable: true });
9791
+ var __defProp$1m = Object.defineProperty;
9792
+ var __name$1m = (target, value) => __defProp$1m(target, "name", { value, configurable: true });
9793
9793
  let UA = "";
9794
9794
  try {
9795
9795
  UA = navigator?.userAgent.toLowerCase();
@@ -9798,7 +9798,7 @@ If you need to send logs from browser, use a proxy server.`;
9798
9798
  }
9799
9799
  class BrowserManager {
9800
9800
  static {
9801
- __name$1l(this, "BrowserManager");
9801
+ __name$1m(this, "BrowserManager");
9802
9802
  }
9803
9803
  isOpera() {
9804
9804
  return UA.includes("opera");
@@ -9936,8 +9936,8 @@ If you need to send logs from browser, use a proxy server.`;
9936
9936
  return ApiVersion2;
9937
9937
  })(ApiVersion || {});
9938
9938
 
9939
- var __defProp$1k = Object.defineProperty;
9940
- var __name$1k = (target, value) => __defProp$1k(target, "name", { value, configurable: true });
9939
+ var __defProp$1l = Object.defineProperty;
9940
+ var __name$1l = (target, value) => __defProp$1l(target, "name", { value, configurable: true });
9941
9941
  var EnumCrmEntityType = /* @__PURE__ */ ((EnumCrmEntityType2) => {
9942
9942
  EnumCrmEntityType2["undefined"] = "UNDEFINED";
9943
9943
  EnumCrmEntityType2["lead"] = "CRM_LEAD";
@@ -9981,7 +9981,7 @@ If you need to send logs from browser, use a proxy server.`;
9981
9981
  const key = EnumCrmEntityTypeId[id];
9982
9982
  return EnumCrmEntityTypeShort[key] || "?" /* undefined */;
9983
9983
  }
9984
- __name$1k(getEnumCrmEntityTypeShort, "getEnumCrmEntityTypeShort");
9984
+ __name$1l(getEnumCrmEntityTypeShort, "getEnumCrmEntityTypeShort");
9985
9985
 
9986
9986
  var ProductRowDiscountTypeId = /* @__PURE__ */ ((ProductRowDiscountTypeId2) => {
9987
9987
  ProductRowDiscountTypeId2[ProductRowDiscountTypeId2["undefined"] = 0] = "undefined";
@@ -10015,8 +10015,8 @@ If you need to send logs from browser, use a proxy server.`;
10015
10015
  return CatalogRoundingRuleType2;
10016
10016
  })(CatalogRoundingRuleType || {});
10017
10017
 
10018
- var __defProp$1j = Object.defineProperty;
10019
- var __name$1j = (target, value) => __defProp$1j(target, "name", { value, configurable: true });
10018
+ var __defProp$1k = Object.defineProperty;
10019
+ var __name$1k = (target, value) => __defProp$1k(target, "name", { value, configurable: true });
10020
10020
  var EnumBitrix24Edition = /* @__PURE__ */ ((EnumBitrix24Edition2) => {
10021
10021
  EnumBitrix24Edition2["undefined"] = "undefined";
10022
10022
  EnumBitrix24Edition2["b24"] = "b24";
@@ -10064,7 +10064,7 @@ If you need to send logs from browser, use a proxy server.`;
10064
10064
  }
10065
10065
  return EnumCrmEntityTypeId.undefined;
10066
10066
  }
10067
- __name$1j(convertBizprocDocumentTypeToCrmEntityTypeId, "convertBizprocDocumentTypeToCrmEntityTypeId");
10067
+ __name$1k(convertBizprocDocumentTypeToCrmEntityTypeId, "convertBizprocDocumentTypeToCrmEntityTypeId");
10068
10068
  function getDocumentType(documentType, entityId) {
10069
10069
  let entityIdFormatted = "";
10070
10070
  let base = "undefined" /* undefined */;
@@ -10132,7 +10132,7 @@ If you need to send logs from browser, use a proxy server.`;
10132
10132
  entityIdFormatted
10133
10133
  ];
10134
10134
  }
10135
- __name$1j(getDocumentType, "getDocumentType");
10135
+ __name$1k(getDocumentType, "getDocumentType");
10136
10136
  function getDocumentId(documentType, id, dynamicId) {
10137
10137
  let entityIdFormatted = "";
10138
10138
  const tmp = getDocumentType(documentType, 1);
@@ -10180,7 +10180,7 @@ If you need to send logs from browser, use a proxy server.`;
10180
10180
  entityIdFormatted
10181
10181
  ];
10182
10182
  }
10183
- __name$1j(getDocumentId, "getDocumentId");
10183
+ __name$1k(getDocumentId, "getDocumentId");
10184
10184
  function getDocumentTypeForFilter(documentType) {
10185
10185
  const result = getDocumentType(documentType, 1);
10186
10186
  return [
@@ -10188,7 +10188,7 @@ If you need to send logs from browser, use a proxy server.`;
10188
10188
  result[1]
10189
10189
  ];
10190
10190
  }
10191
- __name$1j(getDocumentTypeForFilter, "getDocumentTypeForFilter");
10191
+ __name$1k(getDocumentTypeForFilter, "getDocumentTypeForFilter");
10192
10192
 
10193
10193
  var LoadDataType = /* @__PURE__ */ ((LoadDataType2) => {
10194
10194
  LoadDataType2["App"] = "app";
@@ -10355,11 +10355,11 @@ If you need to send logs from browser, use a proxy server.`;
10355
10355
  ["ja" /* ja */]: "ja-JP"
10356
10356
  };
10357
10357
 
10358
- var __defProp$1i = Object.defineProperty;
10359
- var __name$1i = (target, value) => __defProp$1i(target, "name", { value, configurable: true });
10358
+ var __defProp$1j = Object.defineProperty;
10359
+ var __name$1j = (target, value) => __defProp$1j(target, "name", { value, configurable: true });
10360
10360
  class Result {
10361
10361
  static {
10362
- __name$1i(this, "Result");
10362
+ __name$1j(this, "Result");
10363
10363
  }
10364
10364
  _errors;
10365
10365
  _data;
@@ -10444,11 +10444,11 @@ Errors: ${this.getErrorMessages().join(", ")}`;
10444
10444
  }
10445
10445
  }
10446
10446
 
10447
- var __defProp$1h = Object.defineProperty;
10448
- var __name$1h = (target, value) => __defProp$1h(target, "name", { value, configurable: true });
10447
+ var __defProp$1i = Object.defineProperty;
10448
+ var __name$1i = (target, value) => __defProp$1i(target, "name", { value, configurable: true });
10449
10449
  class SdkError extends Error {
10450
10450
  static {
10451
- __name$1h(this, "SdkError");
10451
+ __name$1i(this, "SdkError");
10452
10452
  }
10453
10453
  code;
10454
10454
  _status;
@@ -10517,6 +10517,48 @@ ${this.stack}`;
10517
10517
  }
10518
10518
  }
10519
10519
 
10520
+ var __defProp$1h = Object.defineProperty;
10521
+ var __name$1h = (target, value) => __defProp$1h(target, "name", { value, configurable: true });
10522
+ const SENSITIVE_PARAM_KEYS = [
10523
+ "auth",
10524
+ "password",
10525
+ "token",
10526
+ "secret",
10527
+ "access_token",
10528
+ "refresh_token"
10529
+ ];
10530
+ const REDACTED_PLACEHOLDER = "***REDACTED***";
10531
+ function isPlainObject$1(value) {
10532
+ return value !== null && typeof value === "object" && !Array.isArray(value);
10533
+ }
10534
+ __name$1h(isPlainObject$1, "isPlainObject");
10535
+ function redactObject(source, depth) {
10536
+ const sanitized = { ...source };
10537
+ for (const key of Object.keys(sanitized)) {
10538
+ if (SENSITIVE_PARAM_KEYS.includes(key)) {
10539
+ sanitized[key] = REDACTED_PLACEHOLDER;
10540
+ continue;
10541
+ }
10542
+ if (depth <= 0) continue;
10543
+ const child = sanitized[key];
10544
+ if (isPlainObject$1(child)) {
10545
+ sanitized[key] = redactObject(child, depth - 1);
10546
+ } else if (Array.isArray(child)) {
10547
+ sanitized[key] = child.map(
10548
+ (item) => isPlainObject$1(item) ? redactObject(item, depth - 1) : item
10549
+ );
10550
+ }
10551
+ }
10552
+ return sanitized;
10553
+ }
10554
+ __name$1h(redactObject, "redactObject");
10555
+ const DEFAULT_REDACT_DEPTH = 2;
10556
+ function redactSensitiveParams(params) {
10557
+ if (!isPlainObject$1(params)) return params;
10558
+ return redactObject(params, DEFAULT_REDACT_DEPTH);
10559
+ }
10560
+ __name$1h(redactSensitiveParams, "redactSensitiveParams");
10561
+
10520
10562
  var __defProp$1g = Object.defineProperty;
10521
10563
  var __name$1g = (target, value) => __defProp$1g(target, "name", { value, configurable: true });
10522
10564
  class AjaxError extends SdkError {
@@ -10531,7 +10573,10 @@ ${this.stack}`;
10531
10573
  params.description = AjaxError.formatErrorMessage(params);
10532
10574
  super(params);
10533
10575
  this.name = "AjaxError";
10534
- this.requestInfo = params.requestInfo;
10576
+ this.requestInfo = params.requestInfo ? {
10577
+ ...params.requestInfo,
10578
+ ...params.requestInfo.params !== void 0 ? { params: redactSensitiveParams(params.requestInfo.params) } : {}
10579
+ } : void 0;
10535
10580
  this.cleanErrorStack();
10536
10581
  }
10537
10582
  /**
@@ -10580,7 +10625,7 @@ ${this.stack}`;
10580
10625
  let output = `[${this.name}] ${this.code} (${this._status}): ${this.message}`;
10581
10626
  if (this.requestInfo) {
10582
10627
  output += `
10583
- Request: ${this.requestInfo?.requestId ? `[${this.requestInfo.requestId}] ` : ""}${this.requestInfo.method} ${this.requestInfo.url}`;
10628
+ Request: ${this.requestInfo?.requestId ? `[${this.requestInfo.requestId}] ` : ""}${this.requestInfo.method}`;
10584
10629
  }
10585
10630
  if (this.stack) {
10586
10631
  output += `
@@ -10594,8 +10639,8 @@ ${this.stack}`;
10594
10639
  */
10595
10640
  static formatErrorMessage(params) {
10596
10641
  if (!params?.description) {
10597
- if (params.requestInfo?.method && params.requestInfo.url) {
10598
- return `${params.code} (on ${params.requestInfo.method}${params.requestInfo?.url ? " " + params.requestInfo.url : ""})`;
10642
+ if (params.requestInfo?.method) {
10643
+ return `${params.code} (on ${params.requestInfo.method})`;
10599
10644
  } else {
10600
10645
  return `Internal ajax error`;
10601
10646
  }
@@ -11681,6 +11726,10 @@ ${this.stack}`;
11681
11726
  this.#logError(this.#operatingLimiter.getTitle(), requestId, "OPERATION_TIME_LIMIT", error.message, method, wait);
11682
11727
  return wait;
11683
11728
  }
11729
+ if (this.#isNonRetryableClientError(error)) {
11730
+ this.#logNonRetryableClientError(requestId, error?.code ? `${error.code}` : "?", error?.message ?? "", method, Number(error?.status ?? 0));
11731
+ return 0;
11732
+ }
11684
11733
  if (!this.#isNeedThrowError(error)) {
11685
11734
  const baseDelay = await this.#getErrorBackoff(requestId);
11686
11735
  const maxDelay = Math.max(3e4, baseDelay);
@@ -11722,6 +11771,20 @@ ${this.stack}`;
11722
11771
  async #handleOperatingLimitError(requestId, method, params, _error) {
11723
11772
  return this.#operatingLimiter.getTimeToFree(requestId, method, params, _error);
11724
11773
  }
11774
+ /**
11775
+ * Checks if the error is a non-retryable client error (HTTP 4xx).
11776
+ *
11777
+ * `429` is excluded — it is handled as a rate/operating limit and is retried
11778
+ * with backoff. `408` (request timeout) is excluded — it is transient and is
11779
+ * governed by `retryOnNetworkError`.
11780
+ */
11781
+ #isNonRetryableClientError(error) {
11782
+ const status = Number(error?.status ?? 0);
11783
+ if (Number.isNaN(status)) {
11784
+ return false;
11785
+ }
11786
+ return status >= 400 && status < 500 && status !== 408 && status !== 429;
11787
+ }
11725
11788
  /**
11726
11789
  * Checks whether attempts should be stopped if errors are encountered that are unclear.
11727
11790
  */
@@ -11918,6 +11981,17 @@ ${this.stack}`;
11918
11981
  }
11919
11982
  });
11920
11983
  }
11984
+ #logNonRetryableClientError(requestId, code, message, method, status) {
11985
+ this.getLogger().error(`client error ${status} (${code}) for the ${method} method is not retryable`, {
11986
+ requestId,
11987
+ method,
11988
+ status,
11989
+ error: {
11990
+ code,
11991
+ message
11992
+ }
11993
+ });
11994
+ }
11921
11995
  // endregion ////
11922
11996
  }
11923
11997
 
@@ -12524,7 +12598,7 @@ ${JSON.stringify({
12524
12598
  * const resultData = (response as Result<AjaxResult<{ item: Contact }>[]>).getData()
12525
12599
  * resultData.forEach((resultRow, index) => {
12526
12600
  * if (resultRow.isSuccess) {
12527
- * console.log(`Item ${index + 1}:`, resultRow.getData().result.item)
12601
+ * console.log(`Item ${index + 1}:`, resultRow.getData()!.result.item)
12528
12602
  * }
12529
12603
  * })
12530
12604
  *
@@ -12567,8 +12641,8 @@ ${JSON.stringify({
12567
12641
  * }
12568
12642
  *
12569
12643
  * const results = response.getData() as Record<string, AjaxResult<{ item: Contact } | { item: Deal }>>
12570
- * console.log('Contact:', results.Contact.getData().result.item as Contact)
12571
- * console.log('Deal:', results.Deal.getData().result.item as Deal)
12644
+ * console.log('Contact:', results.Contact.getData()?.result.item as Contact)
12645
+ * console.log('Deal:', results.Deal.getData()?.result.item as Deal)
12572
12646
  *
12573
12647
  * @warning The maximum number of commands in one batch request is 50.
12574
12648
  * @note A batch request executes faster than sequential single calls,
@@ -13049,7 +13123,7 @@ ${JSON.stringify({
13049
13123
  * const resultData = (response as Result<AjaxResult<{ item: TaskItem }>[]>).getData()
13050
13124
  * resultData.forEach((resultRow, index) => {
13051
13125
  * if (resultRow.isSuccess) {
13052
- * console.log(`Item ${index + 1}:`, resultRow.getData().result.item)
13126
+ * console.log(`Item ${index + 1}:`, resultRow.getData()!.result.item)
13053
13127
  * }
13054
13128
  * })
13055
13129
  *
@@ -13088,8 +13162,8 @@ ${JSON.stringify({
13088
13162
  * }
13089
13163
  *
13090
13164
  * const results = response.getData() as Record<string, AjaxResult<{ item: TaskItem } | { items: MainEventLogItem[] }>>
13091
- * console.log('Task:', results.Task.getData().result.item as TaskItem)
13092
- * console.log('MainEventLog:', results.MainEventLog.getData().result.items as MainEventLogItem[])
13165
+ * console.log('Task:', results.Task.getData()?.result.item as TaskItem)
13166
+ * console.log('MainEventLog:', results.MainEventLog.getData()?.result.items as MainEventLogItem[])
13093
13167
  *
13094
13168
  * @warning The maximum number of commands in one batch request is 50.
13095
13169
  * @note A batch request executes faster than sequential single calls,
@@ -13954,9 +14028,9 @@ ${JSON.stringify({
13954
14028
  * also have a `name` and `type` attribute to specify filename and content type
13955
14029
  *
13956
14030
  * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
13957
- *
14031
+ *
13958
14032
  * @param {*} value The value to test
13959
- *
14033
+ *
13960
14034
  * @returns {boolean} True if value is a React Native Blob, otherwise false
13961
14035
  */
13962
14036
  const isReactNativeBlob = (value) => {
@@ -13966,9 +14040,9 @@ ${JSON.stringify({
13966
14040
  /**
13967
14041
  * Determine if environment is React Native
13968
14042
  * ReactNative `FormData` has a non-standard `getParts()` method
13969
- *
14043
+ *
13970
14044
  * @param {*} formData The formData to test
13971
- *
14045
+ *
13972
14046
  * @returns {boolean} True if environment is React Native, otherwise false
13973
14047
  */
13974
14048
  const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
@@ -13987,7 +14061,7 @@ ${JSON.stringify({
13987
14061
  *
13988
14062
  * @param {*} val The value to test
13989
14063
  *
13990
- * @returns {boolean} True if value is a File, otherwise false
14064
+ * @returns {boolean} True if value is a FileList, otherwise false
13991
14065
  */
13992
14066
  const isFileList = kindOfTest('FileList');
13993
14067
 
@@ -14021,14 +14095,16 @@ ${JSON.stringify({
14021
14095
  const isFormData = (thing) => {
14022
14096
  if (!thing) return false;
14023
14097
  if (FormDataCtor && thing instanceof FormDataCtor) return true;
14024
- // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
14098
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
14025
14099
  const proto = getPrototypeOf(thing);
14026
14100
  if (!proto || proto === Object.prototype) return false;
14027
14101
  if (!isFunction$1(thing.append)) return false;
14028
14102
  const kind = kindOf(thing);
14029
- return kind === 'formdata' ||
14103
+ return (
14104
+ kind === 'formdata' ||
14030
14105
  // detect form-data instance
14031
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
14106
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
14107
+ );
14032
14108
  };
14033
14109
 
14034
14110
  /**
@@ -14163,7 +14239,7 @@ ${JSON.stringify({
14163
14239
  *
14164
14240
  * @returns {Object} Result of all merge properties
14165
14241
  */
14166
- function merge(/* obj1, obj2, obj3, ... */) {
14242
+ function merge(...objs) {
14167
14243
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
14168
14244
  const result = {};
14169
14245
  const assignValue = (val, key) => {
@@ -14173,8 +14249,12 @@ ${JSON.stringify({
14173
14249
  }
14174
14250
 
14175
14251
  const targetKey = (caseless && findKey(result, key)) || key;
14176
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
14177
- result[targetKey] = merge(result[targetKey], val);
14252
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
14253
+ // chain, so a polluted Object.prototype value could surface here and get
14254
+ // copied into the merged result.
14255
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
14256
+ if (isPlainObject(existing) && isPlainObject(val)) {
14257
+ result[targetKey] = merge(existing, val);
14178
14258
  } else if (isPlainObject(val)) {
14179
14259
  result[targetKey] = merge({}, val);
14180
14260
  } else if (isArray$2(val)) {
@@ -14184,8 +14264,8 @@ ${JSON.stringify({
14184
14264
  }
14185
14265
  };
14186
14266
 
14187
- for (let i = 0, l = arguments.length; i < l; i++) {
14188
- arguments[i] && forEach(arguments[i], assignValue);
14267
+ for (let i = 0, l = objs.length; i < l; i++) {
14268
+ objs[i] && forEach(objs[i], assignValue);
14189
14269
  }
14190
14270
  return result;
14191
14271
  }
@@ -14207,6 +14287,9 @@ ${JSON.stringify({
14207
14287
  (val, key) => {
14208
14288
  if (thisArg && isFunction$1(val)) {
14209
14289
  Object.defineProperty(a, key, {
14290
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
14291
+ // hijack defineProperty's accessor-vs-data resolution.
14292
+ __proto__: null,
14210
14293
  value: bind(val, thisArg),
14211
14294
  writable: true,
14212
14295
  enumerable: true,
@@ -14214,6 +14297,7 @@ ${JSON.stringify({
14214
14297
  });
14215
14298
  } else {
14216
14299
  Object.defineProperty(a, key, {
14300
+ __proto__: null,
14217
14301
  value: val,
14218
14302
  writable: true,
14219
14303
  enumerable: true,
@@ -14252,12 +14336,14 @@ ${JSON.stringify({
14252
14336
  const inherits = (constructor, superConstructor, props, descriptors) => {
14253
14337
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
14254
14338
  Object.defineProperty(constructor.prototype, 'constructor', {
14339
+ __proto__: null,
14255
14340
  value: constructor,
14256
14341
  writable: true,
14257
14342
  enumerable: false,
14258
14343
  configurable: true,
14259
14344
  });
14260
14345
  Object.defineProperty(constructor, 'super', {
14346
+ __proto__: null,
14261
14347
  value: superConstructor.prototype,
14262
14348
  });
14263
14349
  props && Object.assign(constructor.prototype, props);
@@ -14439,7 +14525,7 @@ ${JSON.stringify({
14439
14525
  const freezeMethods = (obj) => {
14440
14526
  reduceDescriptors(obj, (descriptor, name) => {
14441
14527
  // skip restricted props in strict mode
14442
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
14528
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
14443
14529
  return false;
14444
14530
  }
14445
14531
 
@@ -14513,11 +14599,11 @@ ${JSON.stringify({
14513
14599
  * @returns {Object} The JSON-compatible object.
14514
14600
  */
14515
14601
  const toJSONObject = (obj) => {
14516
- const stack = new Array(10);
14602
+ const visited = new WeakSet();
14517
14603
 
14518
- const visit = (source, i) => {
14604
+ const visit = (source) => {
14519
14605
  if (isObject(source)) {
14520
- if (stack.indexOf(source) >= 0) {
14606
+ if (visited.has(source)) {
14521
14607
  return;
14522
14608
  }
14523
14609
 
@@ -14527,15 +14613,16 @@ ${JSON.stringify({
14527
14613
  }
14528
14614
 
14529
14615
  if (!('toJSON' in source)) {
14530
- stack[i] = source;
14616
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
14617
+ visited.add(source);
14531
14618
  const target = isArray$2(source) ? [] : {};
14532
14619
 
14533
14620
  forEach(source, (value, key) => {
14534
- const reducedValue = visit(value, i + 1);
14621
+ const reducedValue = visit(value);
14535
14622
  !isUndefined(reducedValue) && (target[key] = reducedValue);
14536
14623
  });
14537
14624
 
14538
- stack[i] = undefined;
14625
+ visited.delete(source);
14539
14626
 
14540
14627
  return target;
14541
14628
  }
@@ -14544,7 +14631,7 @@ ${JSON.stringify({
14544
14631
  return source;
14545
14632
  };
14546
14633
 
14547
- return visit(obj, 0);
14634
+ return visit(obj);
14548
14635
  };
14549
14636
 
14550
14637
  /**
@@ -14680,1312 +14767,1423 @@ ${JSON.stringify({
14680
14767
  isIterable,
14681
14768
  };
14682
14769
 
14683
- let AxiosError$1 = class AxiosError extends Error {
14684
- static from(error, code, config, request, response, customProps) {
14685
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
14686
- axiosError.cause = error;
14687
- axiosError.name = error.name;
14770
+ // RawAxiosHeaders whose duplicates are ignored by node
14771
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
14772
+ const ignoreDuplicateOf = utils$1.toObjectSet([
14773
+ 'age',
14774
+ 'authorization',
14775
+ 'content-length',
14776
+ 'content-type',
14777
+ 'etag',
14778
+ 'expires',
14779
+ 'from',
14780
+ 'host',
14781
+ 'if-modified-since',
14782
+ 'if-unmodified-since',
14783
+ 'last-modified',
14784
+ 'location',
14785
+ 'max-forwards',
14786
+ 'proxy-authorization',
14787
+ 'referer',
14788
+ 'retry-after',
14789
+ 'user-agent',
14790
+ ]);
14688
14791
 
14689
- // Preserve status from the original error if not already set from response
14690
- if (error.status != null && axiosError.status == null) {
14691
- axiosError.status = error.status;
14692
- }
14792
+ /**
14793
+ * Parse headers into an object
14794
+ *
14795
+ * ```
14796
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
14797
+ * Content-Type: application/json
14798
+ * Connection: keep-alive
14799
+ * Transfer-Encoding: chunked
14800
+ * ```
14801
+ *
14802
+ * @param {String} rawHeaders Headers needing to be parsed
14803
+ *
14804
+ * @returns {Object} Headers parsed into an object
14805
+ */
14806
+ const parseHeaders = (rawHeaders) => {
14807
+ const parsed = {};
14808
+ let key;
14809
+ let val;
14810
+ let i;
14693
14811
 
14694
- customProps && Object.assign(axiosError, customProps);
14695
- return axiosError;
14696
- }
14812
+ rawHeaders &&
14813
+ rawHeaders.split('\n').forEach(function parser(line) {
14814
+ i = line.indexOf(':');
14815
+ key = line.substring(0, i).trim().toLowerCase();
14816
+ val = line.substring(i + 1).trim();
14697
14817
 
14698
- /**
14699
- * Create an Error with the specified message, config, error code, request and response.
14700
- *
14701
- * @param {string} message The error message.
14702
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
14703
- * @param {Object} [config] The config.
14704
- * @param {Object} [request] The request.
14705
- * @param {Object} [response] The response.
14706
- *
14707
- * @returns {Error} The created error.
14708
- */
14709
- constructor(message, code, config, request, response) {
14710
- super(message);
14818
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
14819
+ return;
14820
+ }
14711
14821
 
14712
- // Make message enumerable to maintain backward compatibility
14713
- // The native Error constructor sets message as non-enumerable,
14714
- // but axios < v1.13.3 had it as enumerable
14715
- Object.defineProperty(this, 'message', {
14716
- value: message,
14717
- enumerable: true,
14718
- writable: true,
14719
- configurable: true,
14822
+ if (key === 'set-cookie') {
14823
+ if (parsed[key]) {
14824
+ parsed[key].push(val);
14825
+ } else {
14826
+ parsed[key] = [val];
14827
+ }
14828
+ } else {
14829
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
14830
+ }
14720
14831
  });
14721
14832
 
14722
- this.name = 'AxiosError';
14723
- this.isAxiosError = true;
14724
- code && (this.code = code);
14725
- config && (this.config = config);
14726
- request && (this.request = request);
14727
- if (response) {
14728
- this.response = response;
14729
- this.status = response.status;
14730
- }
14731
- }
14833
+ return parsed;
14834
+ };
14732
14835
 
14733
- toJSON() {
14734
- return {
14735
- // Standard
14736
- message: this.message,
14737
- name: this.name,
14738
- // Microsoft
14739
- description: this.description,
14740
- number: this.number,
14741
- // Mozilla
14742
- fileName: this.fileName,
14743
- lineNumber: this.lineNumber,
14744
- columnNumber: this.columnNumber,
14745
- stack: this.stack,
14746
- // Axios
14747
- config: utils$1.toJSONObject(this.config),
14748
- code: this.code,
14749
- status: this.status,
14750
- };
14751
- }
14752
- };
14836
+ function trimSPorHTAB(str) {
14837
+ let start = 0;
14838
+ let end = str.length;
14753
14839
 
14754
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
14755
- AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
14756
- AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
14757
- AxiosError$1.ECONNABORTED = 'ECONNABORTED';
14758
- AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
14759
- AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
14760
- AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
14761
- AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
14762
- AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
14763
- AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
14764
- AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
14765
- AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
14766
- AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
14767
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
14840
+ while (start < end) {
14841
+ const code = str.charCodeAt(start);
14768
14842
 
14769
- // eslint-disable-next-line strict
14770
- const httpAdapter = null;
14843
+ if (code !== 0x09 && code !== 0x20) {
14844
+ break;
14845
+ }
14771
14846
 
14772
- /**
14773
- * Determines if the given thing is a array or js object.
14774
- *
14775
- * @param {string} thing - The object or array to be visited.
14776
- *
14777
- * @returns {boolean}
14778
- */
14779
- function isVisitable(thing) {
14780
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
14781
- }
14847
+ start += 1;
14848
+ }
14782
14849
 
14783
- /**
14784
- * It removes the brackets from the end of a string
14785
- *
14786
- * @param {string} key - The key of the parameter.
14787
- *
14788
- * @returns {string} the key without the brackets.
14789
- */
14790
- function removeBrackets(key) {
14791
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
14792
- }
14850
+ while (end > start) {
14851
+ const code = str.charCodeAt(end - 1);
14793
14852
 
14794
- /**
14795
- * It takes a path, a key, and a boolean, and returns a string
14796
- *
14797
- * @param {string} path - The path to the current key.
14798
- * @param {string} key - The key of the current object being iterated over.
14799
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
14800
- *
14801
- * @returns {string} The path to the current key.
14802
- */
14803
- function renderKey(path, key, dots) {
14804
- if (!path) return key;
14805
- return path
14806
- .concat(key)
14807
- .map(function each(token, i) {
14808
- // eslint-disable-next-line no-param-reassign
14809
- token = removeBrackets(token);
14810
- return !dots && i ? '[' + token + ']' : token;
14811
- })
14812
- .join(dots ? '.' : '');
14813
- }
14853
+ if (code !== 0x09 && code !== 0x20) {
14854
+ break;
14855
+ }
14814
14856
 
14815
- /**
14816
- * If the array is an array and none of its elements are visitable, then it's a flat array.
14817
- *
14818
- * @param {Array<any>} arr - The array to check
14819
- *
14820
- * @returns {boolean}
14821
- */
14822
- function isFlatArray(arr) {
14823
- return utils$1.isArray(arr) && !arr.some(isVisitable);
14824
- }
14857
+ end -= 1;
14858
+ }
14825
14859
 
14826
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
14827
- return /^is[A-Z]/.test(prop);
14828
- });
14860
+ return start === 0 && end === str.length ? str : str.slice(start, end);
14861
+ }
14829
14862
 
14830
- /**
14831
- * Convert a data object to FormData
14832
- *
14833
- * @param {Object} obj
14834
- * @param {?Object} [formData]
14835
- * @param {?Object} [options]
14836
- * @param {Function} [options.visitor]
14837
- * @param {Boolean} [options.metaTokens = true]
14838
- * @param {Boolean} [options.dots = false]
14839
- * @param {?Boolean} [options.indexes = false]
14840
- *
14841
- * @returns {Object}
14842
- **/
14863
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
14864
+ // eslint-disable-next-line no-control-regex
14865
+ const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
14866
+ // eslint-disable-next-line no-control-regex
14867
+ const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
14843
14868
 
14844
- /**
14845
- * It converts an object into a FormData object
14846
- *
14847
- * @param {Object<any, any>} obj - The object to convert to form data.
14848
- * @param {string} formData - The FormData object to append to.
14849
- * @param {Object<string, any>} options
14850
- *
14851
- * @returns
14852
- */
14853
- function toFormData$1(obj, formData, options) {
14854
- if (!utils$1.isObject(obj)) {
14855
- throw new TypeError('target must be an object');
14869
+ function sanitizeValue(value, invalidChars) {
14870
+ if (utils$1.isArray(value)) {
14871
+ return value.map((item) => sanitizeValue(item, invalidChars));
14856
14872
  }
14857
14873
 
14858
- // eslint-disable-next-line no-param-reassign
14859
- formData = formData || new (FormData)();
14860
-
14861
- // eslint-disable-next-line no-param-reassign
14862
- options = utils$1.toFlatObject(
14863
- options,
14864
- {
14865
- metaTokens: true,
14866
- dots: false,
14867
- indexes: false,
14868
- },
14869
- false,
14870
- function defined(option, source) {
14871
- // eslint-disable-next-line no-eq-null,eqeqeq
14872
- return !utils$1.isUndefined(source[option]);
14873
- }
14874
- );
14874
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
14875
+ }
14875
14876
 
14876
- const metaTokens = options.metaTokens;
14877
- // eslint-disable-next-line no-use-before-define
14878
- const visitor = options.visitor || defaultVisitor;
14879
- const dots = options.dots;
14880
- const indexes = options.indexes;
14881
- const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
14882
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
14883
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
14877
+ const sanitizeHeaderValue = (value) =>
14878
+ sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
14884
14879
 
14885
- if (!utils$1.isFunction(visitor)) {
14886
- throw new TypeError('visitor must be a function');
14887
- }
14880
+ const sanitizeByteStringHeaderValue = (value) =>
14881
+ sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
14888
14882
 
14889
- function convertValue(value) {
14890
- if (value === null) return '';
14883
+ function toByteStringHeaderObject(headers) {
14884
+ const byteStringHeaders = Object.create(null);
14891
14885
 
14892
- if (utils$1.isDate(value)) {
14893
- return value.toISOString();
14894
- }
14886
+ utils$1.forEach(headers.toJSON(), (value, header) => {
14887
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
14888
+ });
14895
14889
 
14896
- if (utils$1.isBoolean(value)) {
14897
- return value.toString();
14898
- }
14890
+ return byteStringHeaders;
14891
+ }
14899
14892
 
14900
- if (!useBlob && utils$1.isBlob(value)) {
14901
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
14902
- }
14893
+ const $internals = Symbol('internals');
14903
14894
 
14904
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
14905
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
14906
- }
14895
+ function normalizeHeader(header) {
14896
+ return header && String(header).trim().toLowerCase();
14897
+ }
14907
14898
 
14899
+ function normalizeValue(value) {
14900
+ if (value === false || value == null) {
14908
14901
  return value;
14909
14902
  }
14910
14903
 
14911
- /**
14912
- * Default visitor.
14913
- *
14914
- * @param {*} value
14915
- * @param {String|Number} key
14916
- * @param {Array<String|Number>} path
14917
- * @this {FormData}
14918
- *
14919
- * @returns {boolean} return true to visit the each prop of the value recursively
14920
- */
14921
- function defaultVisitor(value, key, path) {
14922
- let arr = value;
14904
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
14905
+ }
14923
14906
 
14924
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
14925
- formData.append(renderKey(path, key, dots), convertValue(value));
14926
- return false;
14927
- }
14907
+ function parseTokens(str) {
14908
+ const tokens = Object.create(null);
14909
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
14910
+ let match;
14928
14911
 
14929
- if (value && !path && typeof value === 'object') {
14930
- if (utils$1.endsWith(key, '{}')) {
14931
- // eslint-disable-next-line no-param-reassign
14932
- key = metaTokens ? key : key.slice(0, -2);
14933
- // eslint-disable-next-line no-param-reassign
14934
- value = JSON.stringify(value);
14935
- } else if (
14936
- (utils$1.isArray(value) && isFlatArray(value)) ||
14937
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
14938
- ) {
14939
- // eslint-disable-next-line no-param-reassign
14940
- key = removeBrackets(key);
14912
+ while ((match = tokensRE.exec(str))) {
14913
+ tokens[match[1]] = match[2];
14914
+ }
14941
14915
 
14942
- arr.forEach(function each(el, index) {
14943
- !(utils$1.isUndefined(el) || el === null) &&
14944
- formData.append(
14945
- // eslint-disable-next-line no-nested-ternary
14946
- indexes === true
14947
- ? renderKey([key], index, dots)
14948
- : indexes === null
14949
- ? key
14950
- : key + '[]',
14951
- convertValue(el)
14952
- );
14953
- });
14954
- return false;
14955
- }
14956
- }
14916
+ return tokens;
14917
+ }
14957
14918
 
14958
- if (isVisitable(value)) {
14959
- return true;
14960
- }
14919
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
14961
14920
 
14962
- formData.append(renderKey(path, key, dots), convertValue(value));
14921
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
14922
+ if (utils$1.isFunction(filter)) {
14923
+ return filter.call(this, value, header);
14924
+ }
14963
14925
 
14964
- return false;
14926
+ if (isHeaderNameFilter) {
14927
+ value = header;
14965
14928
  }
14966
14929
 
14967
- const stack = [];
14930
+ if (!utils$1.isString(value)) return;
14968
14931
 
14969
- const exposedHelpers = Object.assign(predicates, {
14970
- defaultVisitor,
14971
- convertValue,
14972
- isVisitable,
14973
- });
14932
+ if (utils$1.isString(filter)) {
14933
+ return value.indexOf(filter) !== -1;
14934
+ }
14974
14935
 
14975
- function build(value, path, depth = 0) {
14976
- if (utils$1.isUndefined(value)) return;
14977
-
14978
- if (depth > maxDepth) {
14979
- throw new AxiosError$1(
14980
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
14981
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
14982
- );
14983
- }
14984
-
14985
- if (stack.indexOf(value) !== -1) {
14986
- throw Error('Circular reference detected in ' + path.join('.'));
14987
- }
14936
+ if (utils$1.isRegExp(filter)) {
14937
+ return filter.test(value);
14938
+ }
14939
+ }
14988
14940
 
14989
- stack.push(value);
14941
+ function formatHeader(header) {
14942
+ return header
14943
+ .trim()
14944
+ .toLowerCase()
14945
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
14946
+ return char.toUpperCase() + str;
14947
+ });
14948
+ }
14990
14949
 
14991
- utils$1.forEach(value, function each(el, key) {
14992
- const result =
14993
- !(utils$1.isUndefined(el) || el === null) &&
14994
- visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
14950
+ function buildAccessors(obj, header) {
14951
+ const accessorName = utils$1.toCamelCase(' ' + header);
14995
14952
 
14996
- if (result === true) {
14997
- build(el, path ? path.concat(key) : [key], depth + 1);
14998
- }
14953
+ ['get', 'set', 'has'].forEach((methodName) => {
14954
+ Object.defineProperty(obj, methodName + accessorName, {
14955
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
14956
+ // this data descriptor into an accessor descriptor on the way in.
14957
+ __proto__: null,
14958
+ value: function (arg1, arg2, arg3) {
14959
+ return this[methodName].call(this, header, arg1, arg2, arg3);
14960
+ },
14961
+ configurable: true,
14999
14962
  });
14963
+ });
14964
+ }
15000
14965
 
15001
- stack.pop();
15002
- }
15003
-
15004
- if (!utils$1.isObject(obj)) {
15005
- throw new TypeError('data must be an object');
14966
+ let AxiosHeaders$1 = class AxiosHeaders {
14967
+ constructor(headers) {
14968
+ headers && this.set(headers);
15006
14969
  }
15007
14970
 
15008
- build(obj);
14971
+ set(header, valueOrRewrite, rewrite) {
14972
+ const self = this;
15009
14973
 
15010
- return formData;
15011
- }
14974
+ function setHeader(_value, _header, _rewrite) {
14975
+ const lHeader = normalizeHeader(_header);
15012
14976
 
15013
- /**
15014
- * It encodes a string by replacing all characters that are not in the unreserved set with
15015
- * their percent-encoded equivalents
15016
- *
15017
- * @param {string} str - The string to encode.
15018
- *
15019
- * @returns {string} The encoded string.
15020
- */
15021
- function encode$2(str) {
15022
- const charMap = {
15023
- '!': '%21',
15024
- "'": '%27',
15025
- '(': '%28',
15026
- ')': '%29',
15027
- '~': '%7E',
15028
- '%20': '+',
15029
- };
15030
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
15031
- return charMap[match];
15032
- });
15033
- }
14977
+ if (!lHeader) {
14978
+ throw new Error('header name must be a non-empty string');
14979
+ }
15034
14980
 
15035
- /**
15036
- * It takes a params object and converts it to a FormData object
15037
- *
15038
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
15039
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
15040
- *
15041
- * @returns {void}
15042
- */
15043
- function AxiosURLSearchParams(params, options) {
15044
- this._pairs = [];
14981
+ const key = utils$1.findKey(self, lHeader);
15045
14982
 
15046
- params && toFormData$1(params, this, options);
15047
- }
14983
+ if (
14984
+ !key ||
14985
+ self[key] === undefined ||
14986
+ _rewrite === true ||
14987
+ (_rewrite === undefined && self[key] !== false)
14988
+ ) {
14989
+ self[key || _header] = normalizeValue(_value);
14990
+ }
14991
+ }
15048
14992
 
15049
- const prototype = AxiosURLSearchParams.prototype;
14993
+ const setHeaders = (headers, _rewrite) =>
14994
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15050
14995
 
15051
- prototype.append = function append(name, value) {
15052
- this._pairs.push([name, value]);
15053
- };
14996
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
14997
+ setHeaders(header, valueOrRewrite);
14998
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
14999
+ setHeaders(parseHeaders(header), valueOrRewrite);
15000
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15001
+ let obj = {},
15002
+ dest,
15003
+ key;
15004
+ for (const entry of header) {
15005
+ if (!utils$1.isArray(entry)) {
15006
+ throw TypeError('Object iterator must return a key-value pair');
15007
+ }
15054
15008
 
15055
- prototype.toString = function toString(encoder) {
15056
- const _encode = encoder
15057
- ? function (value) {
15058
- return encoder.call(this, value, encode$2);
15009
+ obj[(key = entry[0])] = (dest = obj[key])
15010
+ ? utils$1.isArray(dest)
15011
+ ? [...dest, entry[1]]
15012
+ : [dest, entry[1]]
15013
+ : entry[1];
15059
15014
  }
15060
- : encode$2;
15061
-
15062
- return this._pairs
15063
- .map(function each(pair) {
15064
- return _encode(pair[0]) + '=' + _encode(pair[1]);
15065
- }, '')
15066
- .join('&');
15067
- };
15068
15015
 
15069
- /**
15070
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15071
- * their plain counterparts (`:`, `$`, `,`, `+`).
15072
- *
15073
- * @param {string} val The value to be encoded.
15074
- *
15075
- * @returns {string} The encoded value.
15076
- */
15077
- function encode$1(val) {
15078
- return encodeURIComponent(val)
15079
- .replace(/%3A/gi, ':')
15080
- .replace(/%24/g, '$')
15081
- .replace(/%2C/gi, ',')
15082
- .replace(/%20/g, '+');
15083
- }
15016
+ setHeaders(obj, valueOrRewrite);
15017
+ } else {
15018
+ header != null && setHeader(valueOrRewrite, header, rewrite);
15019
+ }
15084
15020
 
15085
- /**
15086
- * Build a URL by appending params to the end
15087
- *
15088
- * @param {string} url The base of the url (e.g., http://www.google.com)
15089
- * @param {object} [params] The params to be appended
15090
- * @param {?(object|Function)} options
15091
- *
15092
- * @returns {string} The formatted url
15093
- */
15094
- function buildURL(url, params, options) {
15095
- if (!params) {
15096
- return url;
15021
+ return this;
15097
15022
  }
15098
15023
 
15099
- const _encode = (options && options.encode) || encode$1;
15024
+ get(header, parser) {
15025
+ header = normalizeHeader(header);
15100
15026
 
15101
- const _options = utils$1.isFunction(options)
15102
- ? {
15103
- serialize: options,
15104
- }
15105
- : options;
15027
+ if (header) {
15028
+ const key = utils$1.findKey(this, header);
15106
15029
 
15107
- const serializeFn = _options && _options.serialize;
15030
+ if (key) {
15031
+ const value = this[key];
15108
15032
 
15109
- let serializedParams;
15033
+ if (!parser) {
15034
+ return value;
15035
+ }
15110
15036
 
15111
- if (serializeFn) {
15112
- serializedParams = serializeFn(params, _options);
15113
- } else {
15114
- serializedParams = utils$1.isURLSearchParams(params)
15115
- ? params.toString()
15116
- : new AxiosURLSearchParams(params, _options).toString(_encode);
15117
- }
15037
+ if (parser === true) {
15038
+ return parseTokens(value);
15039
+ }
15118
15040
 
15119
- if (serializedParams) {
15120
- const hashmarkIndex = url.indexOf('#');
15041
+ if (utils$1.isFunction(parser)) {
15042
+ return parser.call(this, value, key);
15043
+ }
15121
15044
 
15122
- if (hashmarkIndex !== -1) {
15123
- url = url.slice(0, hashmarkIndex);
15045
+ if (utils$1.isRegExp(parser)) {
15046
+ return parser.exec(value);
15047
+ }
15048
+
15049
+ throw new TypeError('parser must be boolean|regexp|function');
15050
+ }
15124
15051
  }
15125
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
15126
15052
  }
15127
15053
 
15128
- return url;
15129
- }
15130
-
15131
- class InterceptorManager {
15132
- constructor() {
15133
- this.handlers = [];
15134
- }
15054
+ has(header, matcher) {
15055
+ header = normalizeHeader(header);
15135
15056
 
15136
- /**
15137
- * Add a new interceptor to the stack
15138
- *
15139
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
15140
- * @param {Function} rejected The function to handle `reject` for a `Promise`
15141
- * @param {Object} options The options for the interceptor, synchronous and runWhen
15142
- *
15143
- * @return {Number} An ID used to remove interceptor later
15144
- */
15145
- use(fulfilled, rejected, options) {
15146
- this.handlers.push({
15147
- fulfilled,
15148
- rejected,
15149
- synchronous: options ? options.synchronous : false,
15150
- runWhen: options ? options.runWhen : null,
15151
- });
15152
- return this.handlers.length - 1;
15153
- }
15057
+ if (header) {
15058
+ const key = utils$1.findKey(this, header);
15154
15059
 
15155
- /**
15156
- * Remove an interceptor from the stack
15157
- *
15158
- * @param {Number} id The ID that was returned by `use`
15159
- *
15160
- * @returns {void}
15161
- */
15162
- eject(id) {
15163
- if (this.handlers[id]) {
15164
- this.handlers[id] = null;
15060
+ return !!(
15061
+ key &&
15062
+ this[key] !== undefined &&
15063
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
15064
+ );
15165
15065
  }
15066
+
15067
+ return false;
15166
15068
  }
15167
15069
 
15168
- /**
15169
- * Clear all interceptors from the stack
15170
- *
15171
- * @returns {void}
15172
- */
15173
- clear() {
15174
- if (this.handlers) {
15175
- this.handlers = [];
15176
- }
15177
- }
15070
+ delete(header, matcher) {
15071
+ const self = this;
15072
+ let deleted = false;
15178
15073
 
15179
- /**
15180
- * Iterate over all the registered interceptors
15181
- *
15182
- * This method is particularly useful for skipping over any
15183
- * interceptors that may have become `null` calling `eject`.
15184
- *
15185
- * @param {Function} fn The function to call for each interceptor
15186
- *
15187
- * @returns {void}
15188
- */
15189
- forEach(fn) {
15190
- utils$1.forEach(this.handlers, function forEachHandler(h) {
15191
- if (h !== null) {
15192
- fn(h);
15193
- }
15194
- });
15195
- }
15196
- }
15074
+ function deleteHeader(_header) {
15075
+ _header = normalizeHeader(_header);
15197
15076
 
15198
- const transitionalDefaults = {
15199
- silentJSONParsing: true,
15200
- forcedJSONParsing: true,
15201
- clarifyTimeoutError: false,
15202
- legacyInterceptorReqResOrdering: true,
15203
- };
15077
+ if (_header) {
15078
+ const key = utils$1.findKey(self, _header);
15204
15079
 
15205
- const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
15080
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
15081
+ delete self[key];
15206
15082
 
15207
- const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15083
+ deleted = true;
15084
+ }
15085
+ }
15086
+ }
15208
15087
 
15209
- const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15088
+ if (utils$1.isArray(header)) {
15089
+ header.forEach(deleteHeader);
15090
+ } else {
15091
+ deleteHeader(header);
15092
+ }
15210
15093
 
15211
- const platform$1 = {
15212
- isBrowser: true,
15213
- classes: {
15214
- URLSearchParams: URLSearchParams$1,
15215
- FormData: FormData$1,
15216
- Blob: Blob$1,
15217
- },
15218
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
15219
- };
15094
+ return deleted;
15095
+ }
15220
15096
 
15221
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15097
+ clear(matcher) {
15098
+ const keys = Object.keys(this);
15099
+ let i = keys.length;
15100
+ let deleted = false;
15222
15101
 
15223
- const _navigator = (typeof navigator === 'object' && navigator) || undefined;
15102
+ while (i--) {
15103
+ const key = keys[i];
15104
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
15105
+ delete this[key];
15106
+ deleted = true;
15107
+ }
15108
+ }
15224
15109
 
15225
- /**
15226
- * Determine if we're running in a standard browser environment
15227
- *
15228
- * This allows axios to run in a web worker, and react-native.
15229
- * Both environments support XMLHttpRequest, but not fully standard globals.
15230
- *
15231
- * web workers:
15232
- * typeof window -> undefined
15233
- * typeof document -> undefined
15234
- *
15235
- * react-native:
15236
- * navigator.product -> 'ReactNative'
15237
- * nativescript
15238
- * navigator.product -> 'NativeScript' or 'NS'
15239
- *
15240
- * @returns {boolean}
15241
- */
15242
- const hasStandardBrowserEnv =
15243
- hasBrowserEnv &&
15244
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
15110
+ return deleted;
15111
+ }
15245
15112
 
15246
- /**
15247
- * Determine if we're running in a standard browser webWorker environment
15248
- *
15249
- * Although the `isStandardBrowserEnv` method indicates that
15250
- * `allows axios to run in a web worker`, the WebWorker will still be
15251
- * filtered out due to its judgment standard
15252
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15253
- * This leads to a problem when axios post `FormData` in webWorker
15254
- */
15255
- const hasStandardBrowserWebWorkerEnv = (() => {
15256
- return (
15257
- typeof WorkerGlobalScope !== 'undefined' &&
15258
- // eslint-disable-next-line no-undef
15259
- self instanceof WorkerGlobalScope &&
15260
- typeof self.importScripts === 'function'
15261
- );
15262
- })();
15113
+ normalize(format) {
15114
+ const self = this;
15115
+ const headers = {};
15263
15116
 
15264
- const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
15117
+ utils$1.forEach(this, (value, header) => {
15118
+ const key = utils$1.findKey(headers, header);
15265
15119
 
15266
- const utils = {
15267
- __proto__: null,
15268
- hasBrowserEnv: hasBrowserEnv,
15269
- hasStandardBrowserEnv: hasStandardBrowserEnv,
15270
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
15271
- navigator: _navigator,
15272
- origin: origin
15273
- };
15120
+ if (key) {
15121
+ self[key] = normalizeValue(value);
15122
+ delete self[header];
15123
+ return;
15124
+ }
15274
15125
 
15275
- const platform = {
15276
- ...utils,
15277
- ...platform$1,
15278
- };
15126
+ const normalized = format ? formatHeader(header) : String(header).trim();
15279
15127
 
15280
- function toURLEncodedForm(data, options) {
15281
- return toFormData$1(data, new platform.classes.URLSearchParams(), {
15282
- visitor: function (value, key, path, helpers) {
15283
- if (platform.isNode && utils$1.isBuffer(value)) {
15284
- this.append(key, value.toString('base64'));
15285
- return false;
15128
+ if (normalized !== header) {
15129
+ delete self[header];
15286
15130
  }
15287
15131
 
15288
- return helpers.defaultVisitor.apply(this, arguments);
15289
- },
15290
- ...options,
15291
- });
15292
- }
15132
+ self[normalized] = normalizeValue(value);
15293
15133
 
15294
- /**
15295
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
15296
- *
15297
- * @param {string} name - The name of the property to get.
15298
- *
15299
- * @returns An array of strings.
15300
- */
15301
- function parsePropPath(name) {
15302
- // foo[x][y][z]
15303
- // foo.x.y.z
15304
- // foo-x-y-z
15305
- // foo x y z
15306
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
15307
- return match[0] === '[]' ? '' : match[1] || match[0];
15308
- });
15309
- }
15134
+ headers[normalized] = true;
15135
+ });
15310
15136
 
15311
- /**
15312
- * Convert an array to an object.
15313
- *
15314
- * @param {Array<any>} arr - The array to convert to an object.
15315
- *
15316
- * @returns An object with the same keys and values as the array.
15317
- */
15318
- function arrayToObject(arr) {
15319
- const obj = {};
15320
- const keys = Object.keys(arr);
15321
- let i;
15322
- const len = keys.length;
15323
- let key;
15324
- for (i = 0; i < len; i++) {
15325
- key = keys[i];
15326
- obj[key] = arr[key];
15137
+ return this;
15327
15138
  }
15328
- return obj;
15329
- }
15330
15139
 
15331
- /**
15332
- * It takes a FormData object and returns a JavaScript object
15333
- *
15334
- * @param {string} formData The FormData object to convert to JSON.
15335
- *
15336
- * @returns {Object<string, any> | null} The converted object.
15337
- */
15338
- function formDataToJSON(formData) {
15339
- function buildPath(path, value, target, index) {
15340
- let name = path[index++];
15140
+ concat(...targets) {
15141
+ return this.constructor.concat(this, ...targets);
15142
+ }
15341
15143
 
15342
- if (name === '__proto__') return true;
15144
+ toJSON(asStrings) {
15145
+ const obj = Object.create(null);
15343
15146
 
15344
- const isNumericKey = Number.isFinite(+name);
15345
- const isLast = index >= path.length;
15346
- name = !name && utils$1.isArray(target) ? target.length : name;
15147
+ utils$1.forEach(this, (value, header) => {
15148
+ value != null &&
15149
+ value !== false &&
15150
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
15151
+ });
15347
15152
 
15348
- if (isLast) {
15349
- if (utils$1.hasOwnProp(target, name)) {
15350
- target[name] = utils$1.isArray(target[name])
15351
- ? target[name].concat(value)
15352
- : [target[name], value];
15353
- } else {
15354
- target[name] = value;
15355
- }
15153
+ return obj;
15154
+ }
15356
15155
 
15357
- return !isNumericKey;
15358
- }
15156
+ [Symbol.iterator]() {
15157
+ return Object.entries(this.toJSON())[Symbol.iterator]();
15158
+ }
15359
15159
 
15360
- if (!target[name] || !utils$1.isObject(target[name])) {
15361
- target[name] = [];
15362
- }
15160
+ toString() {
15161
+ return Object.entries(this.toJSON())
15162
+ .map(([header, value]) => header + ': ' + value)
15163
+ .join('\n');
15164
+ }
15363
15165
 
15364
- const result = buildPath(path, value, target[name], index);
15166
+ getSetCookie() {
15167
+ return this.get('set-cookie') || [];
15168
+ }
15365
15169
 
15366
- if (result && utils$1.isArray(target[name])) {
15367
- target[name] = arrayToObject(target[name]);
15368
- }
15170
+ get [Symbol.toStringTag]() {
15171
+ return 'AxiosHeaders';
15172
+ }
15369
15173
 
15370
- return !isNumericKey;
15174
+ static from(thing) {
15175
+ return thing instanceof this ? thing : new this(thing);
15371
15176
  }
15372
15177
 
15373
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
15374
- const obj = {};
15178
+ static concat(first, ...targets) {
15179
+ const computed = new this(first);
15375
15180
 
15376
- utils$1.forEachEntry(formData, (name, value) => {
15377
- buildPath(parsePropPath(name), value, obj, 0);
15378
- });
15181
+ targets.forEach((target) => computed.set(target));
15379
15182
 
15380
- return obj;
15183
+ return computed;
15381
15184
  }
15382
15185
 
15383
- return null;
15384
- }
15186
+ static accessor(header) {
15187
+ const internals =
15188
+ (this[$internals] =
15189
+ this[$internals] =
15190
+ {
15191
+ accessors: {},
15192
+ });
15385
15193
 
15386
- const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
15194
+ const accessors = internals.accessors;
15195
+ const prototype = this.prototype;
15387
15196
 
15388
- /**
15389
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
15390
- * of the input
15391
- *
15392
- * @param {any} rawValue - The value to be stringified.
15393
- * @param {Function} parser - A function that parses a string into a JavaScript object.
15394
- * @param {Function} encoder - A function that takes a value and returns a string.
15395
- *
15396
- * @returns {string} A stringified version of the rawValue.
15397
- */
15398
- function stringifySafely(rawValue, parser, encoder) {
15399
- if (utils$1.isString(rawValue)) {
15400
- try {
15401
- (parser || JSON.parse)(rawValue);
15402
- return utils$1.trim(rawValue);
15403
- } catch (e) {
15404
- if (e.name !== 'SyntaxError') {
15405
- throw e;
15197
+ function defineAccessor(_header) {
15198
+ const lHeader = normalizeHeader(_header);
15199
+
15200
+ if (!accessors[lHeader]) {
15201
+ buildAccessors(prototype, _header);
15202
+ accessors[lHeader] = true;
15406
15203
  }
15407
15204
  }
15205
+
15206
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
15207
+
15208
+ return this;
15408
15209
  }
15210
+ };
15409
15211
 
15410
- return (encoder || JSON.stringify)(rawValue);
15411
- }
15212
+ AxiosHeaders$1.accessor([
15213
+ 'Content-Type',
15214
+ 'Content-Length',
15215
+ 'Accept',
15216
+ 'Accept-Encoding',
15217
+ 'User-Agent',
15218
+ 'Authorization',
15219
+ ]);
15412
15220
 
15413
- const defaults$1 = {
15414
- transitional: transitionalDefaults,
15221
+ // reserved names hotfix
15222
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
15223
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
15224
+ return {
15225
+ get: () => value,
15226
+ set(headerValue) {
15227
+ this[mapped] = headerValue;
15228
+ },
15229
+ };
15230
+ });
15415
15231
 
15416
- adapter: ['xhr', 'http', 'fetch'],
15232
+ utils$1.freezeMethods(AxiosHeaders$1);
15417
15233
 
15418
- transformRequest: [
15419
- function transformRequest(data, headers) {
15420
- const contentType = headers.getContentType() || '';
15421
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
15422
- const isObjectPayload = utils$1.isObject(data);
15234
+ const REDACTED = '[REDACTED ****]';
15423
15235
 
15424
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
15425
- data = new FormData(data);
15426
- }
15236
+ function hasOwnOrPrototypeToJSON(source) {
15237
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
15238
+ return true;
15239
+ }
15427
15240
 
15428
- const isFormData = utils$1.isFormData(data);
15241
+ let prototype = Object.getPrototypeOf(source);
15429
15242
 
15430
- if (isFormData) {
15431
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
15432
- }
15243
+ while (prototype && prototype !== Object.prototype) {
15244
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
15245
+ return true;
15246
+ }
15433
15247
 
15434
- if (
15435
- utils$1.isArrayBuffer(data) ||
15436
- utils$1.isBuffer(data) ||
15437
- utils$1.isStream(data) ||
15438
- utils$1.isFile(data) ||
15439
- utils$1.isBlob(data) ||
15440
- utils$1.isReadableStream(data)
15441
- ) {
15442
- return data;
15443
- }
15444
- if (utils$1.isArrayBufferView(data)) {
15445
- return data.buffer;
15446
- }
15447
- if (utils$1.isURLSearchParams(data)) {
15448
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
15449
- return data.toString();
15450
- }
15248
+ prototype = Object.getPrototypeOf(prototype);
15249
+ }
15451
15250
 
15452
- let isFileList;
15251
+ return false;
15252
+ }
15453
15253
 
15454
- if (isObjectPayload) {
15455
- const formSerializer = own(this, 'formSerializer');
15456
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
15457
- return toURLEncodedForm(data, formSerializer).toString();
15458
- }
15254
+ // Build a plain-object snapshot of `config` and replace the value of any key
15255
+ // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
15256
+ // and AxiosHeaders, and short-circuits on circular references.
15257
+ function redactConfig(config, redactKeys) {
15258
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
15259
+ const seen = [];
15459
15260
 
15460
- if (
15461
- (isFileList = utils$1.isFileList(data)) ||
15462
- contentType.indexOf('multipart/form-data') > -1
15463
- ) {
15464
- const env = own(this, 'env');
15465
- const _FormData = env && env.FormData;
15261
+ const visit = (source) => {
15262
+ if (source === null || typeof source !== 'object') return source;
15263
+ if (utils$1.isBuffer(source)) return source;
15264
+ if (seen.indexOf(source) !== -1) return undefined;
15466
15265
 
15467
- return toFormData$1(
15468
- isFileList ? { 'files[]': data } : data,
15469
- _FormData && new _FormData(),
15470
- formSerializer
15471
- );
15266
+ if (source instanceof AxiosHeaders$1) {
15267
+ source = source.toJSON();
15268
+ }
15269
+
15270
+ seen.push(source);
15271
+
15272
+ let result;
15273
+ if (utils$1.isArray(source)) {
15274
+ result = [];
15275
+ source.forEach((v, i) => {
15276
+ const reducedValue = visit(v);
15277
+ if (!utils$1.isUndefined(reducedValue)) {
15278
+ result[i] = reducedValue;
15472
15279
  }
15280
+ });
15281
+ } else {
15282
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
15283
+ seen.pop();
15284
+ return source;
15473
15285
  }
15474
15286
 
15475
- if (isObjectPayload || hasJSONContentType) {
15476
- headers.setContentType('application/json', false);
15477
- return stringifySafely(data);
15287
+ result = Object.create(null);
15288
+ for (const [key, value] of Object.entries(source)) {
15289
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
15290
+ if (!utils$1.isUndefined(reducedValue)) {
15291
+ result[key] = reducedValue;
15292
+ }
15478
15293
  }
15294
+ }
15479
15295
 
15480
- return data;
15481
- },
15482
- ],
15483
-
15484
- transformResponse: [
15485
- function transformResponse(data) {
15486
- const transitional = own(this, 'transitional') || defaults$1.transitional;
15487
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
15488
- const responseType = own(this, 'responseType');
15489
- const JSONRequested = responseType === 'json';
15296
+ seen.pop();
15297
+ return result;
15298
+ };
15490
15299
 
15491
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
15492
- return data;
15493
- }
15300
+ return visit(config);
15301
+ }
15494
15302
 
15495
- if (
15496
- data &&
15497
- utils$1.isString(data) &&
15498
- ((forcedJSONParsing && !responseType) || JSONRequested)
15499
- ) {
15500
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
15501
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
15303
+ let AxiosError$1 = class AxiosError extends Error {
15304
+ static from(error, code, config, request, response, customProps) {
15305
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
15306
+ axiosError.cause = error;
15307
+ axiosError.name = error.name;
15502
15308
 
15503
- try {
15504
- return JSON.parse(data, own(this, 'parseReviver'));
15505
- } catch (e) {
15506
- if (strictJSONParsing) {
15507
- if (e.name === 'SyntaxError') {
15508
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
15509
- }
15510
- throw e;
15511
- }
15512
- }
15513
- }
15309
+ // Preserve status from the original error if not already set from response
15310
+ if (error.status != null && axiosError.status == null) {
15311
+ axiosError.status = error.status;
15312
+ }
15514
15313
 
15515
- return data;
15516
- },
15517
- ],
15314
+ customProps && Object.assign(axiosError, customProps);
15315
+ return axiosError;
15316
+ }
15518
15317
 
15519
15318
  /**
15520
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
15521
- * timeout is not created.
15319
+ * Create an Error with the specified message, config, error code, request and response.
15320
+ *
15321
+ * @param {string} message The error message.
15322
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
15323
+ * @param {Object} [config] The config.
15324
+ * @param {Object} [request] The request.
15325
+ * @param {Object} [response] The response.
15326
+ *
15327
+ * @returns {Error} The created error.
15522
15328
  */
15523
- timeout: 0,
15524
-
15525
- xsrfCookieName: 'XSRF-TOKEN',
15526
- xsrfHeaderName: 'X-XSRF-TOKEN',
15329
+ constructor(message, code, config, request, response) {
15330
+ super(message);
15527
15331
 
15528
- maxContentLength: -1,
15529
- maxBodyLength: -1,
15332
+ // Make message enumerable to maintain backward compatibility
15333
+ // The native Error constructor sets message as non-enumerable,
15334
+ // but axios < v1.13.3 had it as enumerable
15335
+ Object.defineProperty(this, 'message', {
15336
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
15337
+ // this data descriptor into an accessor descriptor on the way in.
15338
+ __proto__: null,
15339
+ value: message,
15340
+ enumerable: true,
15341
+ writable: true,
15342
+ configurable: true,
15343
+ });
15530
15344
 
15531
- env: {
15532
- FormData: platform.classes.FormData,
15533
- Blob: platform.classes.Blob,
15534
- },
15345
+ this.name = 'AxiosError';
15346
+ this.isAxiosError = true;
15347
+ code && (this.code = code);
15348
+ config && (this.config = config);
15349
+ request && (this.request = request);
15350
+ if (response) {
15351
+ this.response = response;
15352
+ this.status = response.status;
15353
+ }
15354
+ }
15535
15355
 
15536
- validateStatus: function validateStatus(status) {
15537
- return status >= 200 && status < 300;
15538
- },
15356
+ toJSON() {
15357
+ // Opt-in redaction: when the request config carries a `redact` array, the
15358
+ // value of any matching key (case-insensitive, at any depth) is replaced
15359
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
15360
+ // existing serialization behavior unchanged.
15361
+ const config = this.config;
15362
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
15363
+ const serializedConfig =
15364
+ utils$1.isArray(redactKeys) && redactKeys.length > 0
15365
+ ? redactConfig(config, redactKeys)
15366
+ : utils$1.toJSONObject(config);
15539
15367
 
15540
- headers: {
15541
- common: {
15542
- Accept: 'application/json, text/plain, */*',
15543
- 'Content-Type': undefined,
15544
- },
15545
- },
15368
+ return {
15369
+ // Standard
15370
+ message: this.message,
15371
+ name: this.name,
15372
+ // Microsoft
15373
+ description: this.description,
15374
+ number: this.number,
15375
+ // Mozilla
15376
+ fileName: this.fileName,
15377
+ lineNumber: this.lineNumber,
15378
+ columnNumber: this.columnNumber,
15379
+ stack: this.stack,
15380
+ // Axios
15381
+ config: serializedConfig,
15382
+ code: this.code,
15383
+ status: this.status,
15384
+ };
15385
+ }
15546
15386
  };
15547
15387
 
15548
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
15549
- defaults$1.headers[method] = {};
15550
- });
15551
-
15552
- // RawAxiosHeaders whose duplicates are ignored by node
15553
- // c.f. https://nodejs.org/api/http.html#http_message_headers
15554
- const ignoreDuplicateOf = utils$1.toObjectSet([
15555
- 'age',
15556
- 'authorization',
15557
- 'content-length',
15558
- 'content-type',
15559
- 'etag',
15560
- 'expires',
15561
- 'from',
15562
- 'host',
15563
- 'if-modified-since',
15564
- 'if-unmodified-since',
15565
- 'last-modified',
15566
- 'location',
15567
- 'max-forwards',
15568
- 'proxy-authorization',
15569
- 'referer',
15570
- 'retry-after',
15571
- 'user-agent',
15572
- ]);
15388
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
15389
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
15390
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
15391
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
15392
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
15393
+ AxiosError$1.ECONNREFUSED = 'ECONNREFUSED';
15394
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
15395
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
15396
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
15397
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
15398
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
15399
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
15400
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
15401
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
15402
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
15403
+
15404
+ // eslint-disable-next-line strict
15405
+ const httpAdapter = null;
15573
15406
 
15574
15407
  /**
15575
- * Parse headers into an object
15408
+ * Determines if the given thing is a array or js object.
15576
15409
  *
15577
- * ```
15578
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
15579
- * Content-Type: application/json
15580
- * Connection: keep-alive
15581
- * Transfer-Encoding: chunked
15582
- * ```
15410
+ * @param {string} thing - The object or array to be visited.
15583
15411
  *
15584
- * @param {String} rawHeaders Headers needing to be parsed
15412
+ * @returns {boolean}
15413
+ */
15414
+ function isVisitable(thing) {
15415
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
15416
+ }
15417
+
15418
+ /**
15419
+ * It removes the brackets from the end of a string
15585
15420
  *
15586
- * @returns {Object} Headers parsed into an object
15421
+ * @param {string} key - The key of the parameter.
15422
+ *
15423
+ * @returns {string} the key without the brackets.
15587
15424
  */
15588
- const parseHeaders = (rawHeaders) => {
15589
- const parsed = {};
15590
- let key;
15591
- let val;
15592
- let i;
15425
+ function removeBrackets(key) {
15426
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
15427
+ }
15593
15428
 
15594
- rawHeaders &&
15595
- rawHeaders.split('\n').forEach(function parser(line) {
15596
- i = line.indexOf(':');
15597
- key = line.substring(0, i).trim().toLowerCase();
15598
- val = line.substring(i + 1).trim();
15429
+ /**
15430
+ * It takes a path, a key, and a boolean, and returns a string
15431
+ *
15432
+ * @param {string} path - The path to the current key.
15433
+ * @param {string} key - The key of the current object being iterated over.
15434
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
15435
+ *
15436
+ * @returns {string} The path to the current key.
15437
+ */
15438
+ function renderKey(path, key, dots) {
15439
+ if (!path) return key;
15440
+ return path
15441
+ .concat(key)
15442
+ .map(function each(token, i) {
15443
+ // eslint-disable-next-line no-param-reassign
15444
+ token = removeBrackets(token);
15445
+ return !dots && i ? '[' + token + ']' : token;
15446
+ })
15447
+ .join(dots ? '.' : '');
15448
+ }
15599
15449
 
15600
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
15601
- return;
15450
+ /**
15451
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
15452
+ *
15453
+ * @param {Array<any>} arr - The array to check
15454
+ *
15455
+ * @returns {boolean}
15456
+ */
15457
+ function isFlatArray(arr) {
15458
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
15459
+ }
15460
+
15461
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
15462
+ return /^is[A-Z]/.test(prop);
15463
+ });
15464
+
15465
+ /**
15466
+ * Convert a data object to FormData
15467
+ *
15468
+ * @param {Object} obj
15469
+ * @param {?Object} [formData]
15470
+ * @param {?Object} [options]
15471
+ * @param {Function} [options.visitor]
15472
+ * @param {Boolean} [options.metaTokens = true]
15473
+ * @param {Boolean} [options.dots = false]
15474
+ * @param {?Boolean} [options.indexes = false]
15475
+ *
15476
+ * @returns {Object}
15477
+ **/
15478
+
15479
+ /**
15480
+ * It converts an object into a FormData object
15481
+ *
15482
+ * @param {Object<any, any>} obj - The object to convert to form data.
15483
+ * @param {string} formData - The FormData object to append to.
15484
+ * @param {Object<string, any>} options
15485
+ *
15486
+ * @returns
15487
+ */
15488
+ function toFormData$1(obj, formData, options) {
15489
+ if (!utils$1.isObject(obj)) {
15490
+ throw new TypeError('target must be an object');
15491
+ }
15492
+
15493
+ // eslint-disable-next-line no-param-reassign
15494
+ formData = formData || new (FormData)();
15495
+
15496
+ // eslint-disable-next-line no-param-reassign
15497
+ options = utils$1.toFlatObject(
15498
+ options,
15499
+ {
15500
+ metaTokens: true,
15501
+ dots: false,
15502
+ indexes: false,
15503
+ },
15504
+ false,
15505
+ function defined(option, source) {
15506
+ // eslint-disable-next-line no-eq-null,eqeqeq
15507
+ return !utils$1.isUndefined(source[option]);
15508
+ }
15509
+ );
15510
+
15511
+ const metaTokens = options.metaTokens;
15512
+ // eslint-disable-next-line no-use-before-define
15513
+ const visitor = options.visitor || defaultVisitor;
15514
+ const dots = options.dots;
15515
+ const indexes = options.indexes;
15516
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
15517
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
15518
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
15519
+
15520
+ if (!utils$1.isFunction(visitor)) {
15521
+ throw new TypeError('visitor must be a function');
15522
+ }
15523
+
15524
+ function convertValue(value) {
15525
+ if (value === null) return '';
15526
+
15527
+ if (utils$1.isDate(value)) {
15528
+ return value.toISOString();
15529
+ }
15530
+
15531
+ if (utils$1.isBoolean(value)) {
15532
+ return value.toString();
15533
+ }
15534
+
15535
+ if (!useBlob && utils$1.isBlob(value)) {
15536
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
15537
+ }
15538
+
15539
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
15540
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
15541
+ }
15542
+
15543
+ return value;
15544
+ }
15545
+
15546
+ /**
15547
+ * Default visitor.
15548
+ *
15549
+ * @param {*} value
15550
+ * @param {String|Number} key
15551
+ * @param {Array<String|Number>} path
15552
+ * @this {FormData}
15553
+ *
15554
+ * @returns {boolean} return true to visit the each prop of the value recursively
15555
+ */
15556
+ function defaultVisitor(value, key, path) {
15557
+ let arr = value;
15558
+
15559
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
15560
+ formData.append(renderKey(path, key, dots), convertValue(value));
15561
+ return false;
15562
+ }
15563
+
15564
+ if (value && !path && typeof value === 'object') {
15565
+ if (utils$1.endsWith(key, '{}')) {
15566
+ // eslint-disable-next-line no-param-reassign
15567
+ key = metaTokens ? key : key.slice(0, -2);
15568
+ // eslint-disable-next-line no-param-reassign
15569
+ value = JSON.stringify(value);
15570
+ } else if (
15571
+ (utils$1.isArray(value) && isFlatArray(value)) ||
15572
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
15573
+ ) {
15574
+ // eslint-disable-next-line no-param-reassign
15575
+ key = removeBrackets(key);
15576
+
15577
+ arr.forEach(function each(el, index) {
15578
+ !(utils$1.isUndefined(el) || el === null) &&
15579
+ formData.append(
15580
+ // eslint-disable-next-line no-nested-ternary
15581
+ indexes === true
15582
+ ? renderKey([key], index, dots)
15583
+ : indexes === null
15584
+ ? key
15585
+ : key + '[]',
15586
+ convertValue(el)
15587
+ );
15588
+ });
15589
+ return false;
15602
15590
  }
15591
+ }
15603
15592
 
15604
- if (key === 'set-cookie') {
15605
- if (parsed[key]) {
15606
- parsed[key].push(val);
15607
- } else {
15608
- parsed[key] = [val];
15609
- }
15610
- } else {
15611
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
15593
+ if (isVisitable(value)) {
15594
+ return true;
15595
+ }
15596
+
15597
+ formData.append(renderKey(path, key, dots), convertValue(value));
15598
+
15599
+ return false;
15600
+ }
15601
+
15602
+ const stack = [];
15603
+
15604
+ const exposedHelpers = Object.assign(predicates, {
15605
+ defaultVisitor,
15606
+ convertValue,
15607
+ isVisitable,
15608
+ });
15609
+
15610
+ function build(value, path, depth = 0) {
15611
+ if (utils$1.isUndefined(value)) return;
15612
+
15613
+ if (depth > maxDepth) {
15614
+ throw new AxiosError$1(
15615
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
15616
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
15617
+ );
15618
+ }
15619
+
15620
+ if (stack.indexOf(value) !== -1) {
15621
+ throw Error('Circular reference detected in ' + path.join('.'));
15622
+ }
15623
+
15624
+ stack.push(value);
15625
+
15626
+ utils$1.forEach(value, function each(el, key) {
15627
+ const result =
15628
+ !(utils$1.isUndefined(el) || el === null) &&
15629
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
15630
+
15631
+ if (result === true) {
15632
+ build(el, path ? path.concat(key) : [key], depth + 1);
15612
15633
  }
15613
15634
  });
15614
15635
 
15615
- return parsed;
15616
- };
15636
+ stack.pop();
15637
+ }
15617
15638
 
15618
- const $internals = Symbol('internals');
15639
+ if (!utils$1.isObject(obj)) {
15640
+ throw new TypeError('data must be an object');
15641
+ }
15619
15642
 
15620
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
15643
+ build(obj);
15621
15644
 
15622
- function trimSPorHTAB(str) {
15623
- let start = 0;
15624
- let end = str.length;
15645
+ return formData;
15646
+ }
15625
15647
 
15626
- while (start < end) {
15627
- const code = str.charCodeAt(start);
15648
+ /**
15649
+ * It encodes a string by replacing all characters that are not in the unreserved set with
15650
+ * their percent-encoded equivalents
15651
+ *
15652
+ * @param {string} str - The string to encode.
15653
+ *
15654
+ * @returns {string} The encoded string.
15655
+ */
15656
+ function encode$2(str) {
15657
+ const charMap = {
15658
+ '!': '%21',
15659
+ "'": '%27',
15660
+ '(': '%28',
15661
+ ')': '%29',
15662
+ '~': '%7E',
15663
+ '%20': '+',
15664
+ };
15665
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
15666
+ return charMap[match];
15667
+ });
15668
+ }
15628
15669
 
15629
- if (code !== 0x09 && code !== 0x20) {
15630
- break;
15631
- }
15670
+ /**
15671
+ * It takes a params object and converts it to a FormData object
15672
+ *
15673
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
15674
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
15675
+ *
15676
+ * @returns {void}
15677
+ */
15678
+ function AxiosURLSearchParams(params, options) {
15679
+ this._pairs = [];
15680
+
15681
+ params && toFormData$1(params, this, options);
15682
+ }
15683
+
15684
+ const prototype = AxiosURLSearchParams.prototype;
15685
+
15686
+ prototype.append = function append(name, value) {
15687
+ this._pairs.push([name, value]);
15688
+ };
15689
+
15690
+ prototype.toString = function toString(encoder) {
15691
+ const _encode = encoder
15692
+ ? function (value) {
15693
+ return encoder.call(this, value, encode$2);
15694
+ }
15695
+ : encode$2;
15696
+
15697
+ return this._pairs
15698
+ .map(function each(pair) {
15699
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
15700
+ }, '')
15701
+ .join('&');
15702
+ };
15703
+
15704
+ /**
15705
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15706
+ * their plain counterparts (`:`, `$`, `,`, `+`).
15707
+ *
15708
+ * @param {string} val The value to be encoded.
15709
+ *
15710
+ * @returns {string} The encoded value.
15711
+ */
15712
+ function encode$1(val) {
15713
+ return encodeURIComponent(val)
15714
+ .replace(/%3A/gi, ':')
15715
+ .replace(/%24/g, '$')
15716
+ .replace(/%2C/gi, ',')
15717
+ .replace(/%20/g, '+');
15718
+ }
15632
15719
 
15633
- start += 1;
15720
+ /**
15721
+ * Build a URL by appending params to the end
15722
+ *
15723
+ * @param {string} url The base of the url (e.g., http://www.google.com)
15724
+ * @param {object} [params] The params to be appended
15725
+ * @param {?(object|Function)} options
15726
+ *
15727
+ * @returns {string} The formatted url
15728
+ */
15729
+ function buildURL(url, params, options) {
15730
+ if (!params) {
15731
+ return url;
15634
15732
  }
15635
15733
 
15636
- while (end > start) {
15637
- const code = str.charCodeAt(end - 1);
15638
-
15639
- if (code !== 0x09 && code !== 0x20) {
15640
- break;
15641
- }
15642
-
15643
- end -= 1;
15644
- }
15734
+ const _encode = (options && options.encode) || encode$1;
15645
15735
 
15646
- return start === 0 && end === str.length ? str : str.slice(start, end);
15647
- }
15736
+ const _options = utils$1.isFunction(options)
15737
+ ? {
15738
+ serialize: options,
15739
+ }
15740
+ : options;
15648
15741
 
15649
- function normalizeHeader(header) {
15650
- return header && String(header).trim().toLowerCase();
15651
- }
15742
+ const serializeFn = _options && _options.serialize;
15652
15743
 
15653
- function sanitizeHeaderValue(str) {
15654
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
15655
- }
15744
+ let serializedParams;
15656
15745
 
15657
- function normalizeValue(value) {
15658
- if (value === false || value == null) {
15659
- return value;
15746
+ if (serializeFn) {
15747
+ serializedParams = serializeFn(params, _options);
15748
+ } else {
15749
+ serializedParams = utils$1.isURLSearchParams(params)
15750
+ ? params.toString()
15751
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
15660
15752
  }
15661
15753
 
15662
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
15663
- }
15664
-
15665
- function parseTokens(str) {
15666
- const tokens = Object.create(null);
15667
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
15668
- let match;
15754
+ if (serializedParams) {
15755
+ const hashmarkIndex = url.indexOf('#');
15669
15756
 
15670
- while ((match = tokensRE.exec(str))) {
15671
- tokens[match[1]] = match[2];
15757
+ if (hashmarkIndex !== -1) {
15758
+ url = url.slice(0, hashmarkIndex);
15759
+ }
15760
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
15672
15761
  }
15673
15762
 
15674
- return tokens;
15763
+ return url;
15675
15764
  }
15676
15765
 
15677
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
15678
-
15679
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15680
- if (utils$1.isFunction(filter)) {
15681
- return filter.call(this, value, header);
15766
+ class InterceptorManager {
15767
+ constructor() {
15768
+ this.handlers = [];
15682
15769
  }
15683
15770
 
15684
- if (isHeaderNameFilter) {
15685
- value = header;
15771
+ /**
15772
+ * Add a new interceptor to the stack
15773
+ *
15774
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
15775
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
15776
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
15777
+ *
15778
+ * @return {Number} An ID used to remove interceptor later
15779
+ */
15780
+ use(fulfilled, rejected, options) {
15781
+ this.handlers.push({
15782
+ fulfilled,
15783
+ rejected,
15784
+ synchronous: options ? options.synchronous : false,
15785
+ runWhen: options ? options.runWhen : null,
15786
+ });
15787
+ return this.handlers.length - 1;
15686
15788
  }
15687
15789
 
15688
- if (!utils$1.isString(value)) return;
15689
-
15690
- if (utils$1.isString(filter)) {
15691
- return value.indexOf(filter) !== -1;
15790
+ /**
15791
+ * Remove an interceptor from the stack
15792
+ *
15793
+ * @param {Number} id The ID that was returned by `use`
15794
+ *
15795
+ * @returns {void}
15796
+ */
15797
+ eject(id) {
15798
+ if (this.handlers[id]) {
15799
+ this.handlers[id] = null;
15800
+ }
15692
15801
  }
15693
15802
 
15694
- if (utils$1.isRegExp(filter)) {
15695
- return filter.test(value);
15803
+ /**
15804
+ * Clear all interceptors from the stack
15805
+ *
15806
+ * @returns {void}
15807
+ */
15808
+ clear() {
15809
+ if (this.handlers) {
15810
+ this.handlers = [];
15811
+ }
15696
15812
  }
15697
- }
15698
15813
 
15699
- function formatHeader(header) {
15700
- return header
15701
- .trim()
15702
- .toLowerCase()
15703
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
15704
- return char.toUpperCase() + str;
15814
+ /**
15815
+ * Iterate over all the registered interceptors
15816
+ *
15817
+ * This method is particularly useful for skipping over any
15818
+ * interceptors that may have become `null` calling `eject`.
15819
+ *
15820
+ * @param {Function} fn The function to call for each interceptor
15821
+ *
15822
+ * @returns {void}
15823
+ */
15824
+ forEach(fn) {
15825
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
15826
+ if (h !== null) {
15827
+ fn(h);
15828
+ }
15705
15829
  });
15830
+ }
15706
15831
  }
15707
15832
 
15708
- function buildAccessors(obj, header) {
15709
- const accessorName = utils$1.toCamelCase(' ' + header);
15710
-
15711
- ['get', 'set', 'has'].forEach((methodName) => {
15712
- Object.defineProperty(obj, methodName + accessorName, {
15713
- value: function (arg1, arg2, arg3) {
15714
- return this[methodName].call(this, header, arg1, arg2, arg3);
15715
- },
15716
- configurable: true,
15717
- });
15718
- });
15719
- }
15833
+ const transitionalDefaults = {
15834
+ silentJSONParsing: true,
15835
+ forcedJSONParsing: true,
15836
+ clarifyTimeoutError: false,
15837
+ legacyInterceptorReqResOrdering: true,
15838
+ };
15720
15839
 
15721
- let AxiosHeaders$1 = class AxiosHeaders {
15722
- constructor(headers) {
15723
- headers && this.set(headers);
15724
- }
15840
+ const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
15725
15841
 
15726
- set(header, valueOrRewrite, rewrite) {
15727
- const self = this;
15842
+ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15728
15843
 
15729
- function setHeader(_value, _header, _rewrite) {
15730
- const lHeader = normalizeHeader(_header);
15844
+ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15731
15845
 
15732
- if (!lHeader) {
15733
- throw new Error('header name must be a non-empty string');
15734
- }
15846
+ const platform$1 = {
15847
+ isBrowser: true,
15848
+ classes: {
15849
+ URLSearchParams: URLSearchParams$1,
15850
+ FormData: FormData$1,
15851
+ Blob: Blob$1,
15852
+ },
15853
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
15854
+ };
15735
15855
 
15736
- const key = utils$1.findKey(self, lHeader);
15856
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15737
15857
 
15738
- if (
15739
- !key ||
15740
- self[key] === undefined ||
15741
- _rewrite === true ||
15742
- (_rewrite === undefined && self[key] !== false)
15743
- ) {
15744
- self[key || _header] = normalizeValue(_value);
15745
- }
15746
- }
15858
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
15747
15859
 
15748
- const setHeaders = (headers, _rewrite) =>
15749
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15860
+ /**
15861
+ * Determine if we're running in a standard browser environment
15862
+ *
15863
+ * This allows axios to run in a web worker, and react-native.
15864
+ * Both environments support XMLHttpRequest, but not fully standard globals.
15865
+ *
15866
+ * web workers:
15867
+ * typeof window -> undefined
15868
+ * typeof document -> undefined
15869
+ *
15870
+ * react-native:
15871
+ * navigator.product -> 'ReactNative'
15872
+ * nativescript
15873
+ * navigator.product -> 'NativeScript' or 'NS'
15874
+ *
15875
+ * @returns {boolean}
15876
+ */
15877
+ const hasStandardBrowserEnv =
15878
+ hasBrowserEnv &&
15879
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
15750
15880
 
15751
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
15752
- setHeaders(header, valueOrRewrite);
15753
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15754
- setHeaders(parseHeaders(header), valueOrRewrite);
15755
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15756
- let obj = {},
15757
- dest,
15758
- key;
15759
- for (const entry of header) {
15760
- if (!utils$1.isArray(entry)) {
15761
- throw TypeError('Object iterator must return a key-value pair');
15762
- }
15881
+ /**
15882
+ * Determine if we're running in a standard browser webWorker environment
15883
+ *
15884
+ * Although the `isStandardBrowserEnv` method indicates that
15885
+ * `allows axios to run in a web worker`, the WebWorker will still be
15886
+ * filtered out due to its judgment standard
15887
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15888
+ * This leads to a problem when axios post `FormData` in webWorker
15889
+ */
15890
+ const hasStandardBrowserWebWorkerEnv = (() => {
15891
+ return (
15892
+ typeof WorkerGlobalScope !== 'undefined' &&
15893
+ // eslint-disable-next-line no-undef
15894
+ self instanceof WorkerGlobalScope &&
15895
+ typeof self.importScripts === 'function'
15896
+ );
15897
+ })();
15763
15898
 
15764
- obj[(key = entry[0])] = (dest = obj[key])
15765
- ? utils$1.isArray(dest)
15766
- ? [...dest, entry[1]]
15767
- : [dest, entry[1]]
15768
- : entry[1];
15769
- }
15899
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
15770
15900
 
15771
- setHeaders(obj, valueOrRewrite);
15772
- } else {
15773
- header != null && setHeader(valueOrRewrite, header, rewrite);
15774
- }
15901
+ const utils = {
15902
+ __proto__: null,
15903
+ hasBrowserEnv: hasBrowserEnv,
15904
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
15905
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
15906
+ navigator: _navigator,
15907
+ origin: origin
15908
+ };
15775
15909
 
15776
- return this;
15777
- }
15910
+ const platform = {
15911
+ ...utils,
15912
+ ...platform$1,
15913
+ };
15778
15914
 
15779
- get(header, parser) {
15780
- header = normalizeHeader(header);
15915
+ function toURLEncodedForm(data, options) {
15916
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
15917
+ visitor: function (value, key, path, helpers) {
15918
+ if (platform.isNode && utils$1.isBuffer(value)) {
15919
+ this.append(key, value.toString('base64'));
15920
+ return false;
15921
+ }
15781
15922
 
15782
- if (header) {
15783
- const key = utils$1.findKey(this, header);
15923
+ return helpers.defaultVisitor.apply(this, arguments);
15924
+ },
15925
+ ...options,
15926
+ });
15927
+ }
15784
15928
 
15785
- if (key) {
15786
- const value = this[key];
15929
+ /**
15930
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
15931
+ *
15932
+ * @param {string} name - The name of the property to get.
15933
+ *
15934
+ * @returns An array of strings.
15935
+ */
15936
+ function parsePropPath(name) {
15937
+ // foo[x][y][z]
15938
+ // foo.x.y.z
15939
+ // foo-x-y-z
15940
+ // foo x y z
15941
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
15942
+ return match[0] === '[]' ? '' : match[1] || match[0];
15943
+ });
15944
+ }
15787
15945
 
15788
- if (!parser) {
15789
- return value;
15790
- }
15946
+ /**
15947
+ * Convert an array to an object.
15948
+ *
15949
+ * @param {Array<any>} arr - The array to convert to an object.
15950
+ *
15951
+ * @returns An object with the same keys and values as the array.
15952
+ */
15953
+ function arrayToObject(arr) {
15954
+ const obj = {};
15955
+ const keys = Object.keys(arr);
15956
+ let i;
15957
+ const len = keys.length;
15958
+ let key;
15959
+ for (i = 0; i < len; i++) {
15960
+ key = keys[i];
15961
+ obj[key] = arr[key];
15962
+ }
15963
+ return obj;
15964
+ }
15791
15965
 
15792
- if (parser === true) {
15793
- return parseTokens(value);
15794
- }
15966
+ /**
15967
+ * It takes a FormData object and returns a JavaScript object
15968
+ *
15969
+ * @param {string} formData The FormData object to convert to JSON.
15970
+ *
15971
+ * @returns {Object<string, any> | null} The converted object.
15972
+ */
15973
+ function formDataToJSON(formData) {
15974
+ function buildPath(path, value, target, index) {
15975
+ let name = path[index++];
15795
15976
 
15796
- if (utils$1.isFunction(parser)) {
15797
- return parser.call(this, value, key);
15798
- }
15977
+ if (name === '__proto__') return true;
15799
15978
 
15800
- if (utils$1.isRegExp(parser)) {
15801
- return parser.exec(value);
15802
- }
15979
+ const isNumericKey = Number.isFinite(+name);
15980
+ const isLast = index >= path.length;
15981
+ name = !name && utils$1.isArray(target) ? target.length : name;
15803
15982
 
15804
- throw new TypeError('parser must be boolean|regexp|function');
15983
+ if (isLast) {
15984
+ if (utils$1.hasOwnProp(target, name)) {
15985
+ target[name] = utils$1.isArray(target[name])
15986
+ ? target[name].concat(value)
15987
+ : [target[name], value];
15988
+ } else {
15989
+ target[name] = value;
15805
15990
  }
15991
+
15992
+ return !isNumericKey;
15806
15993
  }
15807
- }
15808
15994
 
15809
- has(header, matcher) {
15810
- header = normalizeHeader(header);
15995
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
15996
+ target[name] = [];
15997
+ }
15811
15998
 
15812
- if (header) {
15813
- const key = utils$1.findKey(this, header);
15999
+ const result = buildPath(path, value, target[name], index);
15814
16000
 
15815
- return !!(
15816
- key &&
15817
- this[key] !== undefined &&
15818
- (!matcher || matchHeaderValue(this, this[key], key, matcher))
15819
- );
16001
+ if (result && utils$1.isArray(target[name])) {
16002
+ target[name] = arrayToObject(target[name]);
15820
16003
  }
15821
16004
 
15822
- return false;
16005
+ return !isNumericKey;
15823
16006
  }
15824
16007
 
15825
- delete(header, matcher) {
15826
- const self = this;
15827
- let deleted = false;
15828
-
15829
- function deleteHeader(_header) {
15830
- _header = normalizeHeader(_header);
15831
-
15832
- if (_header) {
15833
- const key = utils$1.findKey(self, _header);
15834
-
15835
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
15836
- delete self[key];
15837
-
15838
- deleted = true;
15839
- }
15840
- }
15841
- }
16008
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
16009
+ const obj = {};
15842
16010
 
15843
- if (utils$1.isArray(header)) {
15844
- header.forEach(deleteHeader);
15845
- } else {
15846
- deleteHeader(header);
15847
- }
16011
+ utils$1.forEachEntry(formData, (name, value) => {
16012
+ buildPath(parsePropPath(name), value, obj, 0);
16013
+ });
15848
16014
 
15849
- return deleted;
16015
+ return obj;
15850
16016
  }
15851
16017
 
15852
- clear(matcher) {
15853
- const keys = Object.keys(this);
15854
- let i = keys.length;
15855
- let deleted = false;
16018
+ return null;
16019
+ }
15856
16020
 
15857
- while (i--) {
15858
- const key = keys[i];
15859
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
15860
- delete this[key];
15861
- deleted = true;
16021
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
16022
+
16023
+ /**
16024
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
16025
+ * of the input
16026
+ *
16027
+ * @param {any} rawValue - The value to be stringified.
16028
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
16029
+ * @param {Function} encoder - A function that takes a value and returns a string.
16030
+ *
16031
+ * @returns {string} A stringified version of the rawValue.
16032
+ */
16033
+ function stringifySafely(rawValue, parser, encoder) {
16034
+ if (utils$1.isString(rawValue)) {
16035
+ try {
16036
+ (parser || JSON.parse)(rawValue);
16037
+ return utils$1.trim(rawValue);
16038
+ } catch (e) {
16039
+ if (e.name !== 'SyntaxError') {
16040
+ throw e;
15862
16041
  }
15863
16042
  }
15864
-
15865
- return deleted;
15866
16043
  }
15867
16044
 
15868
- normalize(format) {
15869
- const self = this;
15870
- const headers = {};
16045
+ return (encoder || JSON.stringify)(rawValue);
16046
+ }
15871
16047
 
15872
- utils$1.forEach(this, (value, header) => {
15873
- const key = utils$1.findKey(headers, header);
16048
+ const defaults$1 = {
16049
+ transitional: transitionalDefaults,
15874
16050
 
15875
- if (key) {
15876
- self[key] = normalizeValue(value);
15877
- delete self[header];
15878
- return;
15879
- }
16051
+ adapter: ['xhr', 'http', 'fetch'],
15880
16052
 
15881
- const normalized = format ? formatHeader(header) : String(header).trim();
16053
+ transformRequest: [
16054
+ function transformRequest(data, headers) {
16055
+ const contentType = headers.getContentType() || '';
16056
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
16057
+ const isObjectPayload = utils$1.isObject(data);
15882
16058
 
15883
- if (normalized !== header) {
15884
- delete self[header];
16059
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
16060
+ data = new FormData(data);
15885
16061
  }
15886
16062
 
15887
- self[normalized] = normalizeValue(value);
15888
-
15889
- headers[normalized] = true;
15890
- });
16063
+ const isFormData = utils$1.isFormData(data);
15891
16064
 
15892
- return this;
15893
- }
16065
+ if (isFormData) {
16066
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
16067
+ }
15894
16068
 
15895
- concat(...targets) {
15896
- return this.constructor.concat(this, ...targets);
15897
- }
16069
+ if (
16070
+ utils$1.isArrayBuffer(data) ||
16071
+ utils$1.isBuffer(data) ||
16072
+ utils$1.isStream(data) ||
16073
+ utils$1.isFile(data) ||
16074
+ utils$1.isBlob(data) ||
16075
+ utils$1.isReadableStream(data)
16076
+ ) {
16077
+ return data;
16078
+ }
16079
+ if (utils$1.isArrayBufferView(data)) {
16080
+ return data.buffer;
16081
+ }
16082
+ if (utils$1.isURLSearchParams(data)) {
16083
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
16084
+ return data.toString();
16085
+ }
15898
16086
 
15899
- toJSON(asStrings) {
15900
- const obj = Object.create(null);
16087
+ let isFileList;
15901
16088
 
15902
- utils$1.forEach(this, (value, header) => {
15903
- value != null &&
15904
- value !== false &&
15905
- (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
15906
- });
16089
+ if (isObjectPayload) {
16090
+ const formSerializer = own(this, 'formSerializer');
16091
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
16092
+ return toURLEncodedForm(data, formSerializer).toString();
16093
+ }
15907
16094
 
15908
- return obj;
15909
- }
16095
+ if (
16096
+ (isFileList = utils$1.isFileList(data)) ||
16097
+ contentType.indexOf('multipart/form-data') > -1
16098
+ ) {
16099
+ const env = own(this, 'env');
16100
+ const _FormData = env && env.FormData;
15910
16101
 
15911
- [Symbol.iterator]() {
15912
- return Object.entries(this.toJSON())[Symbol.iterator]();
15913
- }
16102
+ return toFormData$1(
16103
+ isFileList ? { 'files[]': data } : data,
16104
+ _FormData && new _FormData(),
16105
+ formSerializer
16106
+ );
16107
+ }
16108
+ }
15914
16109
 
15915
- toString() {
15916
- return Object.entries(this.toJSON())
15917
- .map(([header, value]) => header + ': ' + value)
15918
- .join('\n');
15919
- }
16110
+ if (isObjectPayload || hasJSONContentType) {
16111
+ headers.setContentType('application/json', false);
16112
+ return stringifySafely(data);
16113
+ }
15920
16114
 
15921
- getSetCookie() {
15922
- return this.get('set-cookie') || [];
15923
- }
16115
+ return data;
16116
+ },
16117
+ ],
15924
16118
 
15925
- get [Symbol.toStringTag]() {
15926
- return 'AxiosHeaders';
15927
- }
16119
+ transformResponse: [
16120
+ function transformResponse(data) {
16121
+ const transitional = own(this, 'transitional') || defaults$1.transitional;
16122
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
16123
+ const responseType = own(this, 'responseType');
16124
+ const JSONRequested = responseType === 'json';
15928
16125
 
15929
- static from(thing) {
15930
- return thing instanceof this ? thing : new this(thing);
15931
- }
16126
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
16127
+ return data;
16128
+ }
15932
16129
 
15933
- static concat(first, ...targets) {
15934
- const computed = new this(first);
16130
+ if (
16131
+ data &&
16132
+ utils$1.isString(data) &&
16133
+ ((forcedJSONParsing && !responseType) || JSONRequested)
16134
+ ) {
16135
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
16136
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
15935
16137
 
15936
- targets.forEach((target) => computed.set(target));
16138
+ try {
16139
+ return JSON.parse(data, own(this, 'parseReviver'));
16140
+ } catch (e) {
16141
+ if (strictJSONParsing) {
16142
+ if (e.name === 'SyntaxError') {
16143
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
16144
+ }
16145
+ throw e;
16146
+ }
16147
+ }
16148
+ }
15937
16149
 
15938
- return computed;
15939
- }
16150
+ return data;
16151
+ },
16152
+ ],
15940
16153
 
15941
- static accessor(header) {
15942
- const internals =
15943
- (this[$internals] =
15944
- this[$internals] =
15945
- {
15946
- accessors: {},
15947
- });
16154
+ /**
16155
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
16156
+ * timeout is not created.
16157
+ */
16158
+ timeout: 0,
15948
16159
 
15949
- const accessors = internals.accessors;
15950
- const prototype = this.prototype;
16160
+ xsrfCookieName: 'XSRF-TOKEN',
16161
+ xsrfHeaderName: 'X-XSRF-TOKEN',
15951
16162
 
15952
- function defineAccessor(_header) {
15953
- const lHeader = normalizeHeader(_header);
16163
+ maxContentLength: -1,
16164
+ maxBodyLength: -1,
15954
16165
 
15955
- if (!accessors[lHeader]) {
15956
- buildAccessors(prototype, _header);
15957
- accessors[lHeader] = true;
15958
- }
15959
- }
16166
+ env: {
16167
+ FormData: platform.classes.FormData,
16168
+ Blob: platform.classes.Blob,
16169
+ },
15960
16170
 
15961
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16171
+ validateStatus: function validateStatus(status) {
16172
+ return status >= 200 && status < 300;
16173
+ },
15962
16174
 
15963
- return this;
15964
- }
16175
+ headers: {
16176
+ common: {
16177
+ Accept: 'application/json, text/plain, */*',
16178
+ 'Content-Type': undefined,
16179
+ },
16180
+ },
15965
16181
  };
15966
16182
 
15967
- AxiosHeaders$1.accessor([
15968
- 'Content-Type',
15969
- 'Content-Length',
15970
- 'Accept',
15971
- 'Accept-Encoding',
15972
- 'User-Agent',
15973
- 'Authorization',
15974
- ]);
15975
-
15976
- // reserved names hotfix
15977
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
15978
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
15979
- return {
15980
- get: () => value,
15981
- set(headerValue) {
15982
- this[mapped] = headerValue;
15983
- },
15984
- };
16183
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
16184
+ defaults$1.headers[method] = {};
15985
16185
  });
15986
16186
 
15987
- utils$1.freezeMethods(AxiosHeaders$1);
15988
-
15989
16187
  /**
15990
16188
  * Transform the data for a request or a response
15991
16189
  *
@@ -16044,22 +16242,18 @@ ${JSON.stringify({
16044
16242
  if (!response.status || !validateStatus || validateStatus(response.status)) {
16045
16243
  resolve(response);
16046
16244
  } else {
16047
- reject(
16048
- new AxiosError$1(
16049
- 'Request failed with status code ' + response.status,
16050
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
16051
- Math.floor(response.status / 100) - 4
16052
- ],
16053
- response.config,
16054
- response.request,
16055
- response
16056
- )
16057
- );
16245
+ reject(new AxiosError$1(
16246
+ 'Request failed with status code ' + response.status,
16247
+ response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
16248
+ response.config,
16249
+ response.request,
16250
+ response
16251
+ ));
16058
16252
  }
16059
16253
  }
16060
16254
 
16061
16255
  function parseProtocol(url) {
16062
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
16256
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
16063
16257
  return (match && match[1]) || '';
16064
16258
  }
16065
16259
 
@@ -16163,6 +16357,9 @@ ${JSON.stringify({
16163
16357
  const _speedometer = speedometer(50, 250);
16164
16358
 
16165
16359
  return throttle((e) => {
16360
+ if (!e || typeof e.loaded !== 'number') {
16361
+ return;
16362
+ }
16166
16363
  const rawLoaded = e.loaded;
16167
16364
  const total = e.lengthComputable ? e.total : undefined;
16168
16365
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -16250,8 +16447,20 @@ ${JSON.stringify({
16250
16447
 
16251
16448
  read(name) {
16252
16449
  if (typeof document === 'undefined') return null;
16253
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
16254
- return match ? decodeURIComponent(match[1]) : null;
16450
+ // Match name=value by splitting on the semicolon separator instead of building a
16451
+ // RegExp from `name` interpolating an unescaped string into a RegExp would let
16452
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
16453
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
16454
+ // "; ", so ignore optional whitespace before each cookie name.
16455
+ const cookies = document.cookie.split(';');
16456
+ for (let i = 0; i < cookies.length; i++) {
16457
+ const cookie = cookies[i].replace(/^\s+/, '');
16458
+ const eq = cookie.indexOf('=');
16459
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
16460
+ return decodeURIComponent(cookie.slice(eq + 1));
16461
+ }
16462
+ }
16463
+ return null;
16255
16464
  },
16256
16465
 
16257
16466
  remove(name) {
@@ -16333,11 +16542,14 @@ ${JSON.stringify({
16333
16542
  config2 = config2 || {};
16334
16543
 
16335
16544
  // Use a null-prototype object so that downstream reads such as `config.auth`
16336
- // or `config.baseURL` cannot inherit polluted values from Object.prototype
16337
- // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
16338
- // own slot to preserve ergonomics for user code that relies on it.
16545
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
16546
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
16547
+ // ergonomics for user code that relies on it.
16339
16548
  const config = Object.create(null);
16340
16549
  Object.defineProperty(config, 'hasOwnProperty', {
16550
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
16551
+ // this data descriptor into an accessor descriptor on the way in.
16552
+ __proto__: null,
16341
16553
  value: Object.prototype.hasOwnProperty,
16342
16554
  enumerable: false,
16343
16555
  writable: true,
@@ -16434,11 +16646,39 @@ ${JSON.stringify({
16434
16646
  return config;
16435
16647
  }
16436
16648
 
16649
+ const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
16650
+
16651
+ function setFormDataHeaders(headers, formHeaders, policy) {
16652
+ if (policy !== 'content-only') {
16653
+ headers.set(formHeaders);
16654
+ return;
16655
+ }
16656
+
16657
+ Object.entries(formHeaders).forEach(([key, val]) => {
16658
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
16659
+ headers.set(key, val);
16660
+ }
16661
+ });
16662
+ }
16663
+
16664
+ /**
16665
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
16666
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
16667
+ *
16668
+ * @param {string} str The string to encode
16669
+ *
16670
+ * @returns {string} UTF-8 bytes as a Latin-1 string
16671
+ */
16672
+ const encodeUTF8 = (str) =>
16673
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
16674
+ String.fromCharCode(parseInt(hex, 16))
16675
+ );
16676
+
16437
16677
  const resolveConfig = (config) => {
16438
16678
  const newConfig = mergeConfig$1({}, config);
16439
16679
 
16440
16680
  // Read only own properties to prevent prototype pollution gadgets
16441
- // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
16681
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
16442
16682
  const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
16443
16683
 
16444
16684
  const data = own('data');
@@ -16464,11 +16704,7 @@ ${JSON.stringify({
16464
16704
  headers.set(
16465
16705
  'Authorization',
16466
16706
  'Basic ' +
16467
- btoa(
16468
- (auth.username || '') +
16469
- ':' +
16470
- (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
16471
- )
16707
+ btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
16472
16708
  );
16473
16709
  }
16474
16710
 
@@ -16477,14 +16713,7 @@ ${JSON.stringify({
16477
16713
  headers.setContentType(undefined); // browser handles it
16478
16714
  } else if (utils$1.isFunction(data.getHeaders)) {
16479
16715
  // Node.js FormData (like form-data package)
16480
- const formHeaders = data.getHeaders();
16481
- // Only set safe headers to avoid overwriting security headers
16482
- const allowedHeaders = ['content-type', 'content-length'];
16483
- Object.entries(formHeaders).forEach(([key, val]) => {
16484
- if (allowedHeaders.includes(key.toLowerCase())) {
16485
- headers.set(key, val);
16486
- }
16487
- });
16716
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
16488
16717
  }
16489
16718
  }
16490
16719
 
@@ -16499,10 +16728,9 @@ ${JSON.stringify({
16499
16728
 
16500
16729
  // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
16501
16730
  // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
16502
- // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
16731
+ // the XSRF token cross-origin.
16503
16732
  const shouldSendXSRF =
16504
- withXSRFToken === true ||
16505
- (withXSRFToken == null && isURLSameOrigin(newConfig.url));
16733
+ withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
16506
16734
 
16507
16735
  if (shouldSendXSRF) {
16508
16736
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -16598,7 +16826,7 @@ ${JSON.stringify({
16598
16826
  // will return status as 0 even though it's a successful request
16599
16827
  if (
16600
16828
  request.status === 0 &&
16601
- !(request.responseURL && request.responseURL.indexOf('file:') === 0)
16829
+ !(request.responseURL && request.responseURL.startsWith('file:'))
16602
16830
  ) {
16603
16831
  return;
16604
16832
  }
@@ -16615,6 +16843,7 @@ ${JSON.stringify({
16615
16843
  }
16616
16844
 
16617
16845
  reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
16846
+ done();
16618
16847
 
16619
16848
  // Clean up request
16620
16849
  request = null;
@@ -16630,6 +16859,7 @@ ${JSON.stringify({
16630
16859
  // attach the underlying event for consumers who want details
16631
16860
  err.event = event || null;
16632
16861
  reject(err);
16862
+ done();
16633
16863
  request = null;
16634
16864
  };
16635
16865
 
@@ -16650,6 +16880,7 @@ ${JSON.stringify({
16650
16880
  request
16651
16881
  )
16652
16882
  );
16883
+ done();
16653
16884
 
16654
16885
  // Clean up request
16655
16886
  request = null;
@@ -16660,7 +16891,7 @@ ${JSON.stringify({
16660
16891
 
16661
16892
  // Add headers to the request
16662
16893
  if ('setRequestHeader' in request) {
16663
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
16894
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
16664
16895
  request.setRequestHeader(key, val);
16665
16896
  });
16666
16897
  }
@@ -16699,6 +16930,7 @@ ${JSON.stringify({
16699
16930
  }
16700
16931
  reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
16701
16932
  request.abort();
16933
+ done();
16702
16934
  request = null;
16703
16935
  };
16704
16936
 
@@ -16712,7 +16944,7 @@ ${JSON.stringify({
16712
16944
 
16713
16945
  const protocol = parseProtocol(_config.url);
16714
16946
 
16715
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
16947
+ if (protocol && !platform.protocols.includes(protocol)) {
16716
16948
  reject(
16717
16949
  new AxiosError$1(
16718
16950
  'Unsupported protocol ' + protocol + ':',
@@ -16729,54 +16961,55 @@ ${JSON.stringify({
16729
16961
  };
16730
16962
 
16731
16963
  const composeSignals = (signals, timeout) => {
16732
- const { length } = (signals = signals ? signals.filter(Boolean) : []);
16733
-
16734
- if (timeout || length) {
16735
- let controller = new AbortController();
16736
-
16737
- let aborted;
16738
-
16739
- const onabort = function (reason) {
16740
- if (!aborted) {
16741
- aborted = true;
16742
- unsubscribe();
16743
- const err = reason instanceof Error ? reason : this.reason;
16744
- controller.abort(
16745
- err instanceof AxiosError$1
16746
- ? err
16747
- : new CanceledError$1(err instanceof Error ? err.message : err)
16748
- );
16749
- }
16750
- };
16964
+ signals = signals ? signals.filter(Boolean) : [];
16751
16965
 
16752
- let timer =
16753
- timeout &&
16754
- setTimeout(() => {
16755
- timer = null;
16756
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
16757
- }, timeout);
16758
-
16759
- const unsubscribe = () => {
16760
- if (signals) {
16761
- timer && clearTimeout(timer);
16762
- timer = null;
16763
- signals.forEach((signal) => {
16764
- signal.unsubscribe
16765
- ? signal.unsubscribe(onabort)
16766
- : signal.removeEventListener('abort', onabort);
16767
- });
16768
- signals = null;
16769
- }
16770
- };
16966
+ if (!timeout && !signals.length) {
16967
+ return;
16968
+ }
16771
16969
 
16772
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
16970
+ const controller = new AbortController();
16773
16971
 
16774
- const { signal } = controller;
16972
+ let aborted = false;
16775
16973
 
16776
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
16974
+ const onabort = function (reason) {
16975
+ if (!aborted) {
16976
+ aborted = true;
16977
+ unsubscribe();
16978
+ const err = reason instanceof Error ? reason : this.reason;
16979
+ controller.abort(
16980
+ err instanceof AxiosError$1
16981
+ ? err
16982
+ : new CanceledError$1(err instanceof Error ? err.message : err)
16983
+ );
16984
+ }
16985
+ };
16777
16986
 
16778
- return signal;
16779
- }
16987
+ let timer =
16988
+ timeout &&
16989
+ setTimeout(() => {
16990
+ timer = null;
16991
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
16992
+ }, timeout);
16993
+
16994
+ const unsubscribe = () => {
16995
+ if (!signals) { return; }
16996
+ timer && clearTimeout(timer);
16997
+ timer = null;
16998
+ signals.forEach((signal) => {
16999
+ signal.unsubscribe
17000
+ ? signal.unsubscribe(onabort)
17001
+ : signal.removeEventListener('abort', onabort);
17002
+ });
17003
+ signals = null;
17004
+ };
17005
+
17006
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
17007
+
17008
+ const { signal } = controller;
17009
+
17010
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
17011
+
17012
+ return signal;
16780
17013
  };
16781
17014
 
16782
17015
  const streamChunk = function* (chunk, chunkSize) {
@@ -16869,16 +17102,112 @@ ${JSON.stringify({
16869
17102
  );
16870
17103
  };
16871
17104
 
16872
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
17105
+ /**
17106
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
17107
+ * - For base64: compute exact decoded size using length and padding;
17108
+ * handle %XX at the character-count level (no string allocation).
17109
+ * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
17110
+ *
17111
+ * @param {string} url
17112
+ * @returns {number}
17113
+ */
17114
+ function estimateDataURLDecodedBytes(url) {
17115
+ if (!url || typeof url !== 'string') return 0;
17116
+ if (!url.startsWith('data:')) return 0;
17117
+
17118
+ const comma = url.indexOf(',');
17119
+ if (comma < 0) return 0;
17120
+
17121
+ const meta = url.slice(5, comma);
17122
+ const body = url.slice(comma + 1);
17123
+ const isBase64 = /;base64/i.test(meta);
17124
+
17125
+ if (isBase64) {
17126
+ let effectiveLen = body.length;
17127
+ const len = body.length; // cache length
17128
+
17129
+ for (let i = 0; i < len; i++) {
17130
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
17131
+ const a = body.charCodeAt(i + 1);
17132
+ const b = body.charCodeAt(i + 2);
17133
+ const isHex =
17134
+ ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
17135
+ ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
17136
+
17137
+ if (isHex) {
17138
+ effectiveLen -= 2;
17139
+ i += 2;
17140
+ }
17141
+ }
17142
+ }
16873
17143
 
16874
- const { isFunction } = utils$1;
17144
+ let pad = 0;
17145
+ let idx = len - 1;
17146
+
17147
+ const tailIsPct3D = (j) =>
17148
+ j >= 2 &&
17149
+ body.charCodeAt(j - 2) === 37 && // '%'
17150
+ body.charCodeAt(j - 1) === 51 && // '3'
17151
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
17152
+
17153
+ if (idx >= 0) {
17154
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
17155
+ pad++;
17156
+ idx--;
17157
+ } else if (tailIsPct3D(idx)) {
17158
+ pad++;
17159
+ idx -= 3;
17160
+ }
17161
+ }
17162
+
17163
+ if (pad === 1 && idx >= 0) {
17164
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
17165
+ pad++;
17166
+ } else if (tailIsPct3D(idx)) {
17167
+ pad++;
17168
+ }
17169
+ }
17170
+
17171
+ const groups = Math.floor(effectiveLen / 4);
17172
+ const bytes = groups * 3 - (pad || 0);
17173
+ return bytes > 0 ? bytes : 0;
17174
+ }
17175
+
17176
+ if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
17177
+ return Buffer.byteLength(body, 'utf8');
17178
+ }
17179
+
17180
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
17181
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
17182
+ // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
17183
+ // but 3 UTF-8 bytes).
17184
+ let bytes = 0;
17185
+ for (let i = 0, len = body.length; i < len; i++) {
17186
+ const c = body.charCodeAt(i);
17187
+ if (c < 0x80) {
17188
+ bytes += 1;
17189
+ } else if (c < 0x800) {
17190
+ bytes += 2;
17191
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
17192
+ const next = body.charCodeAt(i + 1);
17193
+ if (next >= 0xdc00 && next <= 0xdfff) {
17194
+ bytes += 4;
17195
+ i++;
17196
+ } else {
17197
+ bytes += 3;
17198
+ }
17199
+ } else {
17200
+ bytes += 3;
17201
+ }
17202
+ }
17203
+ return bytes;
17204
+ }
17205
+
17206
+ const VERSION$1 = "1.16.1";
16875
17207
 
16876
- const globalFetchAPI = (({ Request, Response }) => ({
16877
- Request,
16878
- Response,
16879
- }))(utils$1.global);
17208
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
16880
17209
 
16881
- const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
17210
+ const { isFunction } = utils$1;
16882
17211
 
16883
17212
  const test = (fn, ...args) => {
16884
17213
  try {
@@ -16889,11 +17218,20 @@ ${JSON.stringify({
16889
17218
  };
16890
17219
 
16891
17220
  const factory = (env) => {
17221
+ const globalObject =
17222
+ utils$1.global !== undefined && utils$1.global !== null
17223
+ ? utils$1.global
17224
+ : globalThis;
17225
+ const { ReadableStream, TextEncoder } = globalObject;
17226
+
16892
17227
  env = utils$1.merge.call(
16893
17228
  {
16894
17229
  skipUndefined: true,
16895
17230
  },
16896
- globalFetchAPI,
17231
+ {
17232
+ Request: globalObject.Request,
17233
+ Response: globalObject.Response,
17234
+ },
16897
17235
  env
16898
17236
  );
16899
17237
 
@@ -16906,7 +17244,7 @@ ${JSON.stringify({
16906
17244
  return false;
16907
17245
  }
16908
17246
 
16909
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
17247
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
16910
17248
 
16911
17249
  const encodeText =
16912
17250
  isFetchSupported &&
@@ -16924,7 +17262,7 @@ ${JSON.stringify({
16924
17262
  let duplexAccessed = false;
16925
17263
 
16926
17264
  const request = new Request(platform.origin, {
16927
- body: new ReadableStream$1(),
17265
+ body: new ReadableStream(),
16928
17266
  method: 'POST',
16929
17267
  get duplex() {
16930
17268
  duplexAccessed = true;
@@ -17020,8 +17358,13 @@ ${JSON.stringify({
17020
17358
  headers,
17021
17359
  withCredentials = 'same-origin',
17022
17360
  fetchOptions,
17361
+ maxContentLength,
17362
+ maxBodyLength,
17023
17363
  } = resolveConfig(config);
17024
17364
 
17365
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
17366
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
17367
+
17025
17368
  let _fetch = envFetch || fetch;
17026
17369
 
17027
17370
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
@@ -17043,6 +17386,41 @@ ${JSON.stringify({
17043
17386
  let requestContentLength;
17044
17387
 
17045
17388
  try {
17389
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
17390
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
17391
+ // "if (protocol === 'data:')" branch).
17392
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
17393
+ const estimated = estimateDataURLDecodedBytes(url);
17394
+ if (estimated > maxContentLength) {
17395
+ throw new AxiosError$1(
17396
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17397
+ AxiosError$1.ERR_BAD_RESPONSE,
17398
+ config,
17399
+ request
17400
+ );
17401
+ }
17402
+ }
17403
+
17404
+ // Enforce maxBodyLength against the outbound request body before dispatch.
17405
+ // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
17406
+ // maxBodyLength limit'). Skip when the body length cannot be determined
17407
+ // (e.g. a live ReadableStream supplied by the caller).
17408
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
17409
+ const outboundLength = await resolveBodyLength(headers, data);
17410
+ if (
17411
+ typeof outboundLength === 'number' &&
17412
+ isFinite(outboundLength) &&
17413
+ outboundLength > maxBodyLength
17414
+ ) {
17415
+ throw new AxiosError$1(
17416
+ 'Request body larger than maxBodyLength limit',
17417
+ AxiosError$1.ERR_BAD_REQUEST,
17418
+ config,
17419
+ request
17420
+ );
17421
+ }
17422
+ }
17423
+
17046
17424
  if (
17047
17425
  onUploadProgress &&
17048
17426
  supportsRequestStream &&
@@ -17093,11 +17471,14 @@ ${JSON.stringify({
17093
17471
  }
17094
17472
  }
17095
17473
 
17474
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
17475
+ headers.set('User-Agent', 'axios/' + VERSION$1, false);
17476
+
17096
17477
  const resolvedOptions = {
17097
17478
  ...fetchOptions,
17098
17479
  signal: composedSignal,
17099
17480
  method: method.toUpperCase(),
17100
- headers: headers.normalize().toJSON(),
17481
+ headers: toByteStringHeaderObject(headers.normalize()),
17101
17482
  body: data,
17102
17483
  duplex: 'half',
17103
17484
  credentials: isCredentialsSupported ? withCredentials : undefined,
@@ -17109,10 +17490,28 @@ ${JSON.stringify({
17109
17490
  ? _fetch(request, fetchOptions)
17110
17491
  : _fetch(url, resolvedOptions));
17111
17492
 
17493
+ // Cheap pre-check: if the server honestly declares a content-length that
17494
+ // already exceeds the cap, reject before we start streaming.
17495
+ if (hasMaxContentLength) {
17496
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
17497
+ if (declaredLength != null && declaredLength > maxContentLength) {
17498
+ throw new AxiosError$1(
17499
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17500
+ AxiosError$1.ERR_BAD_RESPONSE,
17501
+ config,
17502
+ request
17503
+ );
17504
+ }
17505
+ }
17506
+
17112
17507
  const isStreamResponse =
17113
17508
  supportsResponseStream && (responseType === 'stream' || responseType === 'response');
17114
17509
 
17115
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
17510
+ if (
17511
+ supportsResponseStream &&
17512
+ response.body &&
17513
+ (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
17514
+ ) {
17116
17515
  const options = {};
17117
17516
 
17118
17517
  ['status', 'statusText', 'headers'].forEach((prop) => {
@@ -17129,8 +17528,24 @@ ${JSON.stringify({
17129
17528
  )) ||
17130
17529
  [];
17131
17530
 
17531
+ let bytesRead = 0;
17532
+ const onChunkProgress = (loadedBytes) => {
17533
+ if (hasMaxContentLength) {
17534
+ bytesRead = loadedBytes;
17535
+ if (bytesRead > maxContentLength) {
17536
+ throw new AxiosError$1(
17537
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17538
+ AxiosError$1.ERR_BAD_RESPONSE,
17539
+ config,
17540
+ request
17541
+ );
17542
+ }
17543
+ }
17544
+ onProgress && onProgress(loadedBytes);
17545
+ };
17546
+
17132
17547
  response = new Response(
17133
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
17548
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
17134
17549
  flush && flush();
17135
17550
  unsubscribe && unsubscribe();
17136
17551
  }),
@@ -17145,6 +17560,33 @@ ${JSON.stringify({
17145
17560
  config
17146
17561
  );
17147
17562
 
17563
+ // Fallback enforcement for environments without ReadableStream support
17564
+ // (legacy runtimes). Detect materialized size from typed output; skip
17565
+ // streams/Response passthrough since the user will read those themselves.
17566
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
17567
+ let materializedSize;
17568
+ if (responseData != null) {
17569
+ if (typeof responseData.byteLength === 'number') {
17570
+ materializedSize = responseData.byteLength;
17571
+ } else if (typeof responseData.size === 'number') {
17572
+ materializedSize = responseData.size;
17573
+ } else if (typeof responseData === 'string') {
17574
+ materializedSize =
17575
+ typeof TextEncoder === 'function'
17576
+ ? new TextEncoder().encode(responseData).byteLength
17577
+ : responseData.length;
17578
+ }
17579
+ }
17580
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
17581
+ throw new AxiosError$1(
17582
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17583
+ AxiosError$1.ERR_BAD_RESPONSE,
17584
+ config,
17585
+ request
17586
+ );
17587
+ }
17588
+ }
17589
+
17148
17590
  !isStreamResponse && unsubscribe && unsubscribe();
17149
17591
 
17150
17592
  return await new Promise((resolve, reject) => {
@@ -17160,6 +17602,17 @@ ${JSON.stringify({
17160
17602
  } catch (err) {
17161
17603
  unsubscribe && unsubscribe();
17162
17604
 
17605
+ // Safari can surface fetch aborts as a DOMException-like object whose
17606
+ // branded getters throw. Prefer our composed signal reason before reading
17607
+ // the caught error, preserving timeout vs cancellation semantics.
17608
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
17609
+ const canceledError = composedSignal.reason;
17610
+ canceledError.config = config;
17611
+ request && (canceledError.request = request);
17612
+ err !== canceledError && (canceledError.cause = err);
17613
+ throw canceledError;
17614
+ }
17615
+
17163
17616
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
17164
17617
  throw Object.assign(
17165
17618
  new AxiosError$1(
@@ -17228,11 +17681,13 @@ ${JSON.stringify({
17228
17681
  utils$1.forEach(knownAdapters, (fn, value) => {
17229
17682
  if (fn) {
17230
17683
  try {
17231
- Object.defineProperty(fn, 'name', { value });
17684
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
17685
+ // these data descriptors into accessor descriptors on the way in.
17686
+ Object.defineProperty(fn, 'name', { __proto__: null, value });
17232
17687
  } catch (e) {
17233
17688
  // eslint-disable-next-line no-empty
17234
17689
  }
17235
- Object.defineProperty(fn, 'adapterName', { value });
17690
+ Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
17236
17691
  }
17237
17692
  });
17238
17693
 
@@ -17374,8 +17829,15 @@ ${JSON.stringify({
17374
17829
  function onAdapterResolution(response) {
17375
17830
  throwIfCancellationRequested(config);
17376
17831
 
17377
- // Transform response data
17378
- response.data = transformData.call(config, config.transformResponse, response);
17832
+ // Expose the current response on config so that transformResponse can
17833
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
17834
+ // We clean it up afterwards to avoid polluting the config object.
17835
+ config.response = response;
17836
+ try {
17837
+ response.data = transformData.call(config, config.transformResponse, response);
17838
+ } finally {
17839
+ delete config.response;
17840
+ }
17379
17841
 
17380
17842
  response.headers = AxiosHeaders$1.from(response.headers);
17381
17843
 
@@ -17387,11 +17849,16 @@ ${JSON.stringify({
17387
17849
 
17388
17850
  // Transform response data
17389
17851
  if (reason && reason.response) {
17390
- reason.response.data = transformData.call(
17391
- config,
17392
- config.transformResponse,
17393
- reason.response
17394
- );
17852
+ config.response = reason.response;
17853
+ try {
17854
+ reason.response.data = transformData.call(
17855
+ config,
17856
+ config.transformResponse,
17857
+ reason.response
17858
+ );
17859
+ } finally {
17860
+ delete config.response;
17861
+ }
17395
17862
  reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
17396
17863
  }
17397
17864
  }
@@ -17401,8 +17868,6 @@ ${JSON.stringify({
17401
17868
  );
17402
17869
  }
17403
17870
 
17404
- const VERSION$1 = "1.15.2";
17405
-
17406
17871
  const validators$1 = {};
17407
17872
 
17408
17873
  // eslint-disable-next-line func-names
@@ -17487,7 +17952,7 @@ ${JSON.stringify({
17487
17952
  while (i-- > 0) {
17488
17953
  const opt = keys[i];
17489
17954
  // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
17490
- // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
17955
+ // a non-function validator and cause a TypeError.
17491
17956
  const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
17492
17957
  if (validator) {
17493
17958
  const value = options[opt];
@@ -17647,7 +18112,7 @@ ${JSON.stringify({
17647
18112
  let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
17648
18113
 
17649
18114
  headers &&
17650
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
18115
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
17651
18116
  delete headers[method];
17652
18117
  });
17653
18118
 
@@ -17750,7 +18215,7 @@ ${JSON.stringify({
17750
18215
  };
17751
18216
  });
17752
18217
 
17753
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
18218
+ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
17754
18219
  function generateHTTPMethod(isForm) {
17755
18220
  return function httpMethod(url, data, config) {
17756
18221
  return this.request(
@@ -17770,7 +18235,11 @@ ${JSON.stringify({
17770
18235
 
17771
18236
  Axios$1.prototype[method] = generateHTTPMethod();
17772
18237
 
17773
- Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
18238
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
18239
+ // its semantics, so no queryForm shorthand is generated.
18240
+ if (method !== 'query') {
18241
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
18242
+ }
17774
18243
  });
17775
18244
 
17776
18245
  /**
@@ -18104,6 +18573,7 @@ ${JSON.stringify({
18104
18573
  formToJSON,
18105
18574
  getAdapter,
18106
18575
  mergeConfig,
18576
+ create,
18107
18577
  } = axios;
18108
18578
 
18109
18579
  var __defProp$P = Object.defineProperty;
@@ -18163,7 +18633,7 @@ ${JSON.stringify({
18163
18633
  this._logger = LoggerFactory.createNullLogger();
18164
18634
  const defaultHeaders = {};
18165
18635
  if (this.isServerSide()) {
18166
- defaultHeaders["User-Agent"] = "b24-js-sdk/1.1.1";
18636
+ defaultHeaders["User-Agent"] = "b24-js-sdk/1.2.0";
18167
18637
  }
18168
18638
  this._authActions = authActions;
18169
18639
  this._requestIdGenerator = new RequestIdGenerator();
@@ -18430,7 +18900,9 @@ ${JSON.stringify({
18430
18900
  {
18431
18901
  requestId,
18432
18902
  status: error.status,
18433
- responseData: JSON.stringify(error?.response?.data, null, 0)
18903
+ // Redact in case a future portal response embeds credentials in
18904
+ // the error body (today it doesn't, but the channel is open). (#39)
18905
+ responseData: JSON.stringify(redactSensitiveParams(error?.response?.data), null, 0)
18434
18906
  }
18435
18907
  );
18436
18908
  }
@@ -18447,14 +18919,14 @@ ${JSON.stringify({
18447
18919
  async _makeAxiosRequest(requestId, method, params, authData) {
18448
18920
  const methodFormatted = this._prepareMethod(requestId, method, this.getBaseUrl());
18449
18921
  const paramsFormatted = this._prepareParams(authData, params);
18450
- const paramsFormattedForLog = JSON.stringify(paramsFormatted, null, 0);
18922
+ const paramsFormattedForLog = JSON.stringify(redactSensitiveParams(paramsFormatted), null, 0);
18451
18923
  const maxLogLength = 300;
18452
18924
  const sliceLogLength = 100;
18453
18925
  this.getLogger().info(
18454
18926
  `post/send`,
18455
18927
  {
18456
18928
  requestId,
18457
- method: methodFormatted,
18929
+ method,
18458
18930
  params: paramsFormattedForLog.length > maxLogLength ? paramsFormattedForLog.slice(0, sliceLogLength) + "..." : paramsFormattedForLog
18459
18931
  }
18460
18932
  );
@@ -18547,14 +19019,7 @@ ${JSON.stringify({
18547
19019
  // endregion ////
18548
19020
  // region Log ////
18549
19021
  _sanitizeParams(params) {
18550
- const sanitized = { ...params };
18551
- const sensitiveKeys = ["auth", "password", "token", "secret", "access_token", "refresh_token"];
18552
- sensitiveKeys.forEach((key) => {
18553
- if (key in sanitized && sanitized[key]) {
18554
- sanitized[key] = "***REDACTED***";
18555
- }
18556
- });
18557
- return sanitized;
19022
+ return redactSensitiveParams(params);
18558
19023
  }
18559
19024
  _logRequest(requestId, method, params) {
18560
19025
  this.getLogger().debug(`http request starting`, {
@@ -19416,7 +19881,7 @@ ${JSON.stringify({
19416
19881
  }
19417
19882
  const queryParams = new URLSearchParams({
19418
19883
  [this._requestIdGenerator.getQueryStringParameterName()]: requestId,
19419
- [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.1",
19884
+ [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.2.0",
19420
19885
  [this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
19421
19886
  });
19422
19887
  return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
@@ -19670,7 +20135,7 @@ ${JSON.stringify({
19670
20135
  const methodUrl = `/${encodeURIComponent(method)}`;
19671
20136
  const queryParams = new URLSearchParams({
19672
20137
  [this._requestIdGenerator.getQueryStringParameterName()]: requestId,
19673
- [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.1",
20138
+ [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.2.0",
19674
20139
  [this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
19675
20140
  });
19676
20141
  return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
@@ -23223,7 +23688,7 @@ ${JSON.stringify({
23223
23688
  var protobuf = $require(entries[0]);
23224
23689
  if (module && module.exports)
23225
23690
  module.exports = protobuf;
23226
- }), "prelude"))({ 1: [function(require2, module2, exports$1) {
23691
+ }), "prelude"))({ 1: [function(require2, module2, exports) {
23227
23692
  module2.exports = asPromise;
23228
23693
  function asPromise(fn, ctx) {
23229
23694
  var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
@@ -23254,8 +23719,8 @@ ${JSON.stringify({
23254
23719
  }, "executor"));
23255
23720
  }
23256
23721
  __name(asPromise, "asPromise");
23257
- }, {}], 2: [function(require2, module2, exports$1) {
23258
- var base64 = exports$1;
23722
+ }, {}], 2: [function(require2, module2, exports) {
23723
+ var base64 = exports;
23259
23724
  base64.length = /* @__PURE__ */ __name(function length(string) {
23260
23725
  var p = string.length;
23261
23726
  if (!p)
@@ -23347,7 +23812,7 @@ ${JSON.stringify({
23347
23812
  base64.test = /* @__PURE__ */ __name(function test(string) {
23348
23813
  return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
23349
23814
  }, "test");
23350
- }, {}], 3: [function(require2, module2, exports$1) {
23815
+ }, {}], 3: [function(require2, module2, exports) {
23351
23816
  module2.exports = codegen;
23352
23817
  function codegen(functionParams, functionName) {
23353
23818
  if (typeof functionParams === "string") {
@@ -23406,7 +23871,7 @@ ${JSON.stringify({
23406
23871
  }
23407
23872
  __name(codegen, "codegen");
23408
23873
  codegen.verbose = false;
23409
- }, {}], 4: [function(require2, module2, exports$1) {
23874
+ }, {}], 4: [function(require2, module2, exports) {
23410
23875
  module2.exports = EventEmitter;
23411
23876
  function EventEmitter() {
23412
23877
  this._listeners = {};
@@ -23447,7 +23912,7 @@ ${JSON.stringify({
23447
23912
  }
23448
23913
  return this;
23449
23914
  }, "emit");
23450
- }, {}], 5: [function(require2, module2, exports$1) {
23915
+ }, {}], 5: [function(require2, module2, exports) {
23451
23916
  module2.exports = fetch;
23452
23917
  var asPromise = require2(1), inquire = require2(7);
23453
23918
  var fs = inquire("fs");
@@ -23492,7 +23957,7 @@ ${JSON.stringify({
23492
23957
  xhr.open("GET", filename);
23493
23958
  xhr.send();
23494
23959
  }, "fetch_xhr");
23495
- }, { "1": 1, "7": 7 }], 6: [function(require2, module2, exports$1) {
23960
+ }, { "1": 1, "7": 7 }], 6: [function(require2, module2, exports) {
23496
23961
  module2.exports = factory(factory);
23497
23962
  function factory(exports2) {
23498
23963
  if (typeof Float32Array !== "undefined") (function() {
@@ -23697,7 +24162,7 @@ ${JSON.stringify({
23697
24162
  return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0;
23698
24163
  }
23699
24164
  __name(readUintBE, "readUintBE");
23700
- }, {}], 7: [function(require2, module2, exports$1) {
24165
+ }, {}], 7: [function(require2, module2, exports) {
23701
24166
  module2.exports = inquire;
23702
24167
  function inquire(moduleName) {
23703
24168
  try {
@@ -23709,8 +24174,8 @@ ${JSON.stringify({
23709
24174
  return null;
23710
24175
  }
23711
24176
  __name(inquire, "inquire");
23712
- }, {}], 8: [function(require2, module2, exports$1) {
23713
- var path = exports$1;
24177
+ }, {}], 8: [function(require2, module2, exports) {
24178
+ var path = exports;
23714
24179
  var isAbsolute = (
23715
24180
  /**
23716
24181
  * Tests if the specified path is absolute.
@@ -23757,7 +24222,7 @@ ${JSON.stringify({
23757
24222
  originPath = normalize(originPath);
23758
24223
  return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
23759
24224
  }, "resolve");
23760
- }, {}], 9: [function(require2, module2, exports$1) {
24225
+ }, {}], 9: [function(require2, module2, exports) {
23761
24226
  module2.exports = pool;
23762
24227
  function pool(alloc, slice, size) {
23763
24228
  var SIZE = size || 8192;
@@ -23778,8 +24243,8 @@ ${JSON.stringify({
23778
24243
  }, "pool_alloc");
23779
24244
  }
23780
24245
  __name(pool, "pool");
23781
- }, {}], 10: [function(require2, module2, exports$1) {
23782
- var utf8 = exports$1;
24246
+ }, {}], 10: [function(require2, module2, exports) {
24247
+ var utf8 = exports;
23783
24248
  utf8.length = /* @__PURE__ */ __name(function utf8_length(string) {
23784
24249
  var len = 0, c = 0;
23785
24250
  for (var i = 0; i < string.length; ++i) {
@@ -23849,7 +24314,7 @@ ${JSON.stringify({
23849
24314
  }
23850
24315
  return offset - start;
23851
24316
  }, "utf8_write");
23852
- }, {}], 11: [function(require2, module2, exports$1) {
24317
+ }, {}], 11: [function(require2, module2, exports) {
23853
24318
  module2.exports = common;
23854
24319
  var commonRe = /\/|\./;
23855
24320
  function common(name, json) {
@@ -24176,8 +24641,8 @@ ${JSON.stringify({
24176
24641
  common.get = /* @__PURE__ */ __name(function get(file) {
24177
24642
  return common[file] || null;
24178
24643
  }, "get");
24179
- }, {}], 12: [function(require2, module2, exports$1) {
24180
- var converter = exports$1;
24644
+ }, {}], 12: [function(require2, module2, exports) {
24645
+ var converter = exports;
24181
24646
  var Enum = require2(15), util = require2(37);
24182
24647
  function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
24183
24648
  if (field.resolvedType) {
@@ -24368,7 +24833,7 @@ ${JSON.stringify({
24368
24833
  }
24369
24834
  return gen("return d");
24370
24835
  }, "toObject");
24371
- }, { "15": 15, "37": 37 }], 13: [function(require2, module2, exports$1) {
24836
+ }, { "15": 15, "37": 37 }], 13: [function(require2, module2, exports) {
24372
24837
  module2.exports = decoder;
24373
24838
  var Enum = require2(15), types = require2(36), util = require2(37);
24374
24839
  function missing(field) {
@@ -24412,7 +24877,7 @@ ${JSON.stringify({
24412
24877
  return gen("return m");
24413
24878
  }
24414
24879
  __name(decoder, "decoder");
24415
- }, { "15": 15, "36": 36, "37": 37 }], 14: [function(require2, module2, exports$1) {
24880
+ }, { "15": 15, "36": 36, "37": 37 }], 14: [function(require2, module2, exports) {
24416
24881
  module2.exports = encoder;
24417
24882
  var Enum = require2(15), types = require2(36), util = require2(37);
24418
24883
  function genTypePartial(gen, field, fieldIndex, ref) {
@@ -24455,7 +24920,7 @@ ${JSON.stringify({
24455
24920
  return gen("return w");
24456
24921
  }
24457
24922
  __name(encoder, "encoder");
24458
- }, { "15": 15, "36": 36, "37": 37 }], 15: [function(require2, module2, exports$1) {
24923
+ }, { "15": 15, "36": 36, "37": 37 }], 15: [function(require2, module2, exports) {
24459
24924
  module2.exports = Enum;
24460
24925
  var ReflectionObject = require2(24);
24461
24926
  ((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum";
@@ -24533,7 +24998,7 @@ ${JSON.stringify({
24533
24998
  Enum.prototype.isReservedName = /* @__PURE__ */ __name(function isReservedName(name) {
24534
24999
  return Namespace.isReservedName(this.reserved, name);
24535
25000
  }, "isReservedName");
24536
- }, { "23": 23, "24": 24, "37": 37 }], 16: [function(require2, module2, exports$1) {
25001
+ }, { "23": 23, "24": 24, "37": 37 }], 16: [function(require2, module2, exports) {
24537
25002
  module2.exports = Field;
24538
25003
  var ReflectionObject = require2(24);
24539
25004
  ((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field";
@@ -24670,7 +25135,7 @@ ${JSON.stringify({
24670
25135
  Field._configure = /* @__PURE__ */ __name(function configure(Type_) {
24671
25136
  Type = Type_;
24672
25137
  }, "configure");
24673
- }, { "15": 15, "24": 24, "36": 36, "37": 37 }], 17: [function(require2, module2, exports$1) {
25138
+ }, { "15": 15, "24": 24, "36": 36, "37": 37 }], 17: [function(require2, module2, exports) {
24674
25139
  var protobuf = module2.exports = require2(18);
24675
25140
  protobuf.build = "light";
24676
25141
  function load(filename, root, callback) {
@@ -24712,8 +25177,8 @@ ${JSON.stringify({
24712
25177
  protobuf.Namespace._configure(protobuf.Type, protobuf.Service);
24713
25178
  protobuf.Root._configure(protobuf.Type);
24714
25179
  protobuf.Field._configure(protobuf.Type);
24715
- }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "18": 18, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "29": 29, "33": 33, "35": 35, "36": 36, "37": 37, "40": 40, "41": 41 }], 18: [function(require2, module2, exports$1) {
24716
- var protobuf = exports$1;
25180
+ }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "18": 18, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "29": 29, "33": 33, "35": 35, "36": 36, "37": 37, "40": 40, "41": 41 }], 18: [function(require2, module2, exports) {
25181
+ var protobuf = exports;
24717
25182
  protobuf.build = "minimal";
24718
25183
  protobuf.Writer = require2(42);
24719
25184
  protobuf.BufferWriter = require2(43);
@@ -24730,14 +25195,14 @@ ${JSON.stringify({
24730
25195
  __name(configure, "configure");
24731
25196
  protobuf.Writer._configure(protobuf.BufferWriter);
24732
25197
  configure();
24733
- }, { "27": 27, "28": 28, "30": 30, "31": 31, "39": 39, "42": 42, "43": 43 }], 19: [function(require2, module2, exports$1) {
25198
+ }, { "27": 27, "28": 28, "30": 30, "31": 31, "39": 39, "42": 42, "43": 43 }], 19: [function(require2, module2, exports) {
24734
25199
  var protobuf = module2.exports = require2(17);
24735
25200
  protobuf.build = "full";
24736
25201
  protobuf.tokenize = require2(34);
24737
25202
  protobuf.parse = require2(26);
24738
25203
  protobuf.common = require2(11);
24739
25204
  protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);
24740
- }, { "11": 11, "17": 17, "26": 26, "34": 34 }], 20: [function(require2, module2, exports$1) {
25205
+ }, { "11": 11, "17": 17, "26": 26, "34": 34 }], 20: [function(require2, module2, exports) {
24741
25206
  module2.exports = MapField;
24742
25207
  var Field = require2(16);
24743
25208
  ((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField";
@@ -24787,7 +25252,7 @@ ${JSON.stringify({
24787
25252
  util.decorateType(prototype.constructor).add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));
24788
25253
  }, "mapFieldDecorator");
24789
25254
  }, "decorateMapField");
24790
- }, { "16": 16, "36": 36, "37": 37 }], 21: [function(require2, module2, exports$1) {
25255
+ }, { "16": 16, "36": 36, "37": 37 }], 21: [function(require2, module2, exports) {
24791
25256
  module2.exports = Message;
24792
25257
  var util = require2(39);
24793
25258
  function Message(properties) {
@@ -24823,7 +25288,7 @@ ${JSON.stringify({
24823
25288
  Message.prototype.toJSON = /* @__PURE__ */ __name(function toJSON() {
24824
25289
  return this.$type.toObject(this, util.toJSONOptions);
24825
25290
  }, "toJSON");
24826
- }, { "39": 39 }], 22: [function(require2, module2, exports$1) {
25291
+ }, { "39": 39 }], 22: [function(require2, module2, exports) {
24827
25292
  module2.exports = Method;
24828
25293
  var ReflectionObject = require2(24);
24829
25294
  ((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method";
@@ -24883,7 +25348,7 @@ ${JSON.stringify({
24883
25348
  this.resolvedResponseType = this.parent.lookupType(this.responseType);
24884
25349
  return ReflectionObject.prototype.resolve.call(this);
24885
25350
  }, "resolve");
24886
- }, { "24": 24, "37": 37 }], 23: [function(require2, module2, exports$1) {
25351
+ }, { "24": 24, "37": 37 }], 23: [function(require2, module2, exports) {
24887
25352
  module2.exports = Namespace;
24888
25353
  var ReflectionObject = require2(24);
24889
25354
  ((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";
@@ -25085,7 +25550,7 @@ ${JSON.stringify({
25085
25550
  Type = Type_;
25086
25551
  Service = Service_;
25087
25552
  };
25088
- }, { "15": 15, "16": 16, "24": 24, "37": 37 }], 24: [function(require2, module2, exports$1) {
25553
+ }, { "15": 15, "16": 16, "24": 24, "37": 37 }], 24: [function(require2, module2, exports) {
25089
25554
  module2.exports = ReflectionObject;
25090
25555
  ReflectionObject.className = "ReflectionObject";
25091
25556
  var util = require2(37);
@@ -25187,7 +25652,7 @@ ${JSON.stringify({
25187
25652
  ReflectionObject._configure = function(Root_) {
25188
25653
  Root = Root_;
25189
25654
  };
25190
- }, { "37": 37 }], 25: [function(require2, module2, exports$1) {
25655
+ }, { "37": 37 }], 25: [function(require2, module2, exports) {
25191
25656
  module2.exports = OneOf;
25192
25657
  var ReflectionObject = require2(24);
25193
25658
  ((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf";
@@ -25281,7 +25746,7 @@ ${JSON.stringify({
25281
25746
  });
25282
25747
  }, "oneOfDecorator");
25283
25748
  }, "decorateOneOf");
25284
- }, { "16": 16, "24": 24, "37": 37 }], 26: [function(require2, module2, exports$1) {
25749
+ }, { "16": 16, "24": 24, "37": 37 }], 26: [function(require2, module2, exports) {
25285
25750
  module2.exports = parse;
25286
25751
  parse.filename = null;
25287
25752
  parse.defaults = { keepCase: false };
@@ -25830,7 +26295,7 @@ ${JSON.stringify({
25830
26295
  };
25831
26296
  }
25832
26297
  __name(parse, "parse");
25833
- }, { "15": 15, "16": 16, "20": 20, "22": 22, "25": 25, "29": 29, "33": 33, "34": 34, "35": 35, "36": 36, "37": 37 }], 27: [function(require2, module2, exports$1) {
26298
+ }, { "15": 15, "16": 16, "20": 20, "22": 22, "25": 25, "29": 29, "33": 33, "34": 34, "35": 35, "36": 36, "37": 37 }], 27: [function(require2, module2, exports) {
25834
26299
  module2.exports = Reader;
25835
26300
  var util = require2(39);
25836
26301
  var BufferReader;
@@ -26045,7 +26510,7 @@ ${JSON.stringify({
26045
26510
  }, "read_sfixed64")
26046
26511
  });
26047
26512
  };
26048
- }, { "39": 39 }], 28: [function(require2, module2, exports$1) {
26513
+ }, { "39": 39 }], 28: [function(require2, module2, exports) {
26049
26514
  module2.exports = BufferReader;
26050
26515
  var Reader = require2(27);
26051
26516
  (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
@@ -26060,7 +26525,7 @@ ${JSON.stringify({
26060
26525
  var len = this.uint32();
26061
26526
  return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));
26062
26527
  }, "read_string_buffer");
26063
- }, { "27": 27, "39": 39 }], 29: [function(require2, module2, exports$1) {
26528
+ }, { "27": 27, "39": 39 }], 29: [function(require2, module2, exports) {
26064
26529
  module2.exports = Root;
26065
26530
  var Namespace = require2(23);
26066
26531
  ((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root";
@@ -26277,12 +26742,12 @@ ${JSON.stringify({
26277
26742
  parse = parse_;
26278
26743
  common = common_;
26279
26744
  };
26280
- }, { "15": 15, "16": 16, "23": 23, "25": 25, "37": 37 }], 30: [function(require2, module2, exports$1) {
26745
+ }, { "15": 15, "16": 16, "23": 23, "25": 25, "37": 37 }], 30: [function(require2, module2, exports) {
26281
26746
  module2.exports = {};
26282
- }, {}], 31: [function(require2, module2, exports$1) {
26283
- var rpc = exports$1;
26747
+ }, {}], 31: [function(require2, module2, exports) {
26748
+ var rpc = exports;
26284
26749
  rpc.Service = require2(32);
26285
- }, { "32": 32 }], 32: [function(require2, module2, exports$1) {
26750
+ }, { "32": 32 }], 32: [function(require2, module2, exports) {
26286
26751
  module2.exports = Service;
26287
26752
  var util = require2(39);
26288
26753
  (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
@@ -26352,7 +26817,7 @@ ${JSON.stringify({
26352
26817
  }
26353
26818
  return this;
26354
26819
  }, "end");
26355
- }, { "39": 39 }], 33: [function(require2, module2, exports$1) {
26820
+ }, { "39": 39 }], 33: [function(require2, module2, exports) {
26356
26821
  module2.exports = Service;
26357
26822
  var Namespace = require2(23);
26358
26823
  ((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service";
@@ -26440,7 +26905,7 @@ ${JSON.stringify({
26440
26905
  }
26441
26906
  return rpcService;
26442
26907
  }, "create");
26443
- }, { "22": 22, "23": 23, "31": 31, "37": 37 }], 34: [function(require2, module2, exports$1) {
26908
+ }, { "22": 22, "23": 23, "31": 31, "37": 37 }], 34: [function(require2, module2, exports) {
26444
26909
  module2.exports = tokenize;
26445
26910
  var delimRe = /[\s{}=;:[\],'"()<>]/g, stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g;
26446
26911
  var setCommentRe = /^ *[*/]+ */, setCommentAltRe = /^\s*\*?\/*/, setCommentSplitRe = /\n/g, whitespaceRe = /\s/, unescapeRe = /\\(.?)/g;
@@ -26671,7 +27136,7 @@ ${JSON.stringify({
26671
27136
  });
26672
27137
  }
26673
27138
  __name(tokenize, "tokenize");
26674
- }, {}], 35: [function(require2, module2, exports$1) {
27139
+ }, {}], 35: [function(require2, module2, exports) {
26675
27140
  module2.exports = Type;
26676
27141
  var Namespace = require2(23);
26677
27142
  ((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type";
@@ -26971,8 +27436,8 @@ ${JSON.stringify({
26971
27436
  util.decorateType(target, typeName);
26972
27437
  }, "typeDecorator");
26973
27438
  }, "decorateType");
26974
- }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "20": 20, "21": 21, "23": 23, "25": 25, "27": 27, "33": 33, "37": 37, "40": 40, "41": 41, "42": 42 }], 36: [function(require2, module2, exports$1) {
26975
- var types = exports$1;
27439
+ }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "20": 20, "21": 21, "23": 23, "25": 25, "27": 27, "33": 33, "37": 37, "40": 40, "41": 41, "42": 42 }], 36: [function(require2, module2, exports) {
27440
+ var types = exports;
26976
27441
  var util = require2(37);
26977
27442
  var s = [
26978
27443
  "double",
@@ -27145,7 +27610,7 @@ ${JSON.stringify({
27145
27610
  /* bool */
27146
27611
  0
27147
27612
  ]);
27148
- }, { "37": 37 }], 37: [function(require2, module2, exports$1) {
27613
+ }, { "37": 37 }], 37: [function(require2, module2, exports) {
27149
27614
  var util = module2.exports = require2(39);
27150
27615
  var roots = require2(30);
27151
27616
  var Type, Enum;
@@ -27226,7 +27691,7 @@ ${JSON.stringify({
27226
27691
  return roots["decorated"] || (roots["decorated"] = new (require2(29))());
27227
27692
  }, "get")
27228
27693
  });
27229
- }, { "15": 15, "29": 29, "3": 3, "30": 30, "35": 35, "39": 39, "5": 5, "8": 8 }], 38: [function(require2, module2, exports$1) {
27694
+ }, { "15": 15, "29": 29, "3": 3, "30": 30, "35": 35, "39": 39, "5": 5, "8": 8 }], 38: [function(require2, module2, exports) {
27230
27695
  module2.exports = LongBits;
27231
27696
  var util = require2(39);
27232
27697
  function LongBits(lo, hi) {
@@ -27323,8 +27788,8 @@ ${JSON.stringify({
27323
27788
  var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24;
27324
27789
  return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10;
27325
27790
  }, "length");
27326
- }, { "39": 39 }], 39: [function(require2, module2, exports$1) {
27327
- var util = exports$1;
27791
+ }, { "39": 39 }], 39: [function(require2, module2, exports) {
27792
+ var util = exports;
27328
27793
  util.asPromise = require2(1);
27329
27794
  util.base64 = require2(2);
27330
27795
  util.EventEmitter = require2(4);
@@ -27472,7 +27937,7 @@ ${JSON.stringify({
27472
27937
  return new Buffer2(size);
27473
27938
  }, "Buffer_allocUnsafe");
27474
27939
  };
27475
- }, { "1": 1, "10": 10, "2": 2, "38": 38, "4": 4, "6": 6, "7": 7, "9": 9 }], 40: [function(require2, module2, exports$1) {
27940
+ }, { "1": 1, "10": 10, "2": 2, "38": 38, "4": 4, "6": 6, "7": 7, "9": 9 }], 40: [function(require2, module2, exports) {
27476
27941
  module2.exports = verifier;
27477
27942
  var Enum = require2(15), util = require2(37);
27478
27943
  function invalid(field, expected) {
@@ -27574,8 +28039,8 @@ ${JSON.stringify({
27574
28039
  return gen("return null");
27575
28040
  }
27576
28041
  __name(verifier, "verifier");
27577
- }, { "15": 15, "37": 37 }], 41: [function(require2, module2, exports$1) {
27578
- var wrappers = exports$1;
28042
+ }, { "15": 15, "37": 37 }], 41: [function(require2, module2, exports) {
28043
+ var wrappers = exports;
27579
28044
  var Message = require2(21);
27580
28045
  wrappers[".google.protobuf.Any"] = {
27581
28046
  fromObject: /* @__PURE__ */ __name(function(object) {
@@ -27606,7 +28071,7 @@ ${JSON.stringify({
27606
28071
  return this.toObject(message, options);
27607
28072
  }, "toObject")
27608
28073
  };
27609
- }, { "21": 21 }], 42: [function(require2, module2, exports$1) {
28074
+ }, { "21": 21 }], 42: [function(require2, module2, exports) {
27610
28075
  module2.exports = Writer;
27611
28076
  var util = require2(39);
27612
28077
  var BufferWriter;
@@ -27793,7 +28258,7 @@ ${JSON.stringify({
27793
28258
  Writer._configure = function(BufferWriter_) {
27794
28259
  BufferWriter = BufferWriter_;
27795
28260
  };
27796
- }, { "39": 39 }], 43: [function(require2, module2, exports$1) {
28261
+ }, { "39": 39 }], 43: [function(require2, module2, exports) {
27797
28262
  module2.exports = BufferWriter;
27798
28263
  var Writer = require2(42);
27799
28264
  (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;