@jerome-benoit/sap-ai-provider 4.6.9 → 4.7.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 (40) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-4RRRJBEL.js → chunk-36DFHUVQ.js} +407 -275
  4. package/dist/chunk-36DFHUVQ.js.map +1 -0
  5. package/dist/{chunk-EXOXZ5OU.js → chunk-4JIMBRMV.js} +44 -7
  6. package/dist/chunk-4JIMBRMV.js.map +1 -0
  7. package/dist/{chunk-DYFBCE2W.js → chunk-BZZJKLDG.js} +60 -6
  8. package/dist/chunk-BZZJKLDG.js.map +1 -0
  9. package/dist/chunk-GMMX46AH.js +93 -0
  10. package/dist/chunk-GMMX46AH.js.map +1 -0
  11. package/dist/{chunk-F4MUYVQJ.js → chunk-TVXWNZQT.js} +1714 -865
  12. package/dist/chunk-TVXWNZQT.js.map +1 -0
  13. package/dist/chunk-WDUOKIKD.js +188 -0
  14. package/dist/chunk-WDUOKIKD.js.map +1 -0
  15. package/dist/{foundation-models-embedding-model-strategy-3MMM3QDC.js → foundation-models-embedding-model-strategy-YWPDIJEN.js} +8 -4
  16. package/dist/foundation-models-embedding-model-strategy-YWPDIJEN.js.map +1 -0
  17. package/dist/{foundation-models-language-model-strategy-OPGTN6DA.js → foundation-models-language-model-strategy-WDSQWU64.js} +15 -10
  18. package/dist/foundation-models-language-model-strategy-WDSQWU64.js.map +1 -0
  19. package/dist/index.cjs +2620 -1503
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +66 -66
  22. package/dist/index.d.ts +66 -66
  23. package/dist/index.js +11 -172
  24. package/dist/index.js.map +1 -1
  25. package/dist/{orchestration-embedding-model-strategy-R6G6VVU6.js → orchestration-embedding-model-strategy-66QYAO64.js} +14 -4
  26. package/dist/orchestration-embedding-model-strategy-66QYAO64.js.map +1 -0
  27. package/dist/{orchestration-language-model-strategy-KFW3CFRY.js → orchestration-language-model-strategy-4TKRZK7U.js} +52 -77
  28. package/dist/orchestration-language-model-strategy-4TKRZK7U.js.map +1 -0
  29. package/package.json +20 -14
  30. package/LICENSE.md +0 -187
  31. package/dist/chunk-4RRRJBEL.js.map +0 -1
  32. package/dist/chunk-DYFBCE2W.js.map +0 -1
  33. package/dist/chunk-EXOXZ5OU.js.map +0 -1
  34. package/dist/chunk-F4MUYVQJ.js.map +0 -1
  35. package/dist/chunk-NQJIUL3F.js +0 -61
  36. package/dist/chunk-NQJIUL3F.js.map +0 -1
  37. package/dist/foundation-models-embedding-model-strategy-3MMM3QDC.js.map +0 -1
  38. package/dist/foundation-models-language-model-strategy-OPGTN6DA.js.map +0 -1
  39. package/dist/orchestration-embedding-model-strategy-R6G6VVU6.js.map +0 -1
  40. package/dist/orchestration-language-model-strategy-KFW3CFRY.js.map +0 -1
@@ -24179,6 +24179,456 @@ var require_src = __commonJS({
24179
24179
  }
24180
24180
  });
24181
24181
 
24182
+ // node_modules/agent-base/dist/src/promisify.js
24183
+ var require_promisify = __commonJS({
24184
+ "node_modules/agent-base/dist/src/promisify.js"(exports) {
24185
+ "use strict";
24186
+ Object.defineProperty(exports, "__esModule", { value: true });
24187
+ function promisify(fn) {
24188
+ return function(req, opts) {
24189
+ return new Promise((resolve, reject) => {
24190
+ fn.call(this, req, opts, (err, rtn) => {
24191
+ if (err) {
24192
+ reject(err);
24193
+ } else {
24194
+ resolve(rtn);
24195
+ }
24196
+ });
24197
+ });
24198
+ };
24199
+ }
24200
+ exports.default = promisify;
24201
+ }
24202
+ });
24203
+
24204
+ // node_modules/agent-base/dist/src/index.js
24205
+ var require_src2 = __commonJS({
24206
+ "node_modules/agent-base/dist/src/index.js"(exports, module) {
24207
+ "use strict";
24208
+ var __importDefault = exports && exports.__importDefault || function(mod) {
24209
+ return mod && mod.__esModule ? mod : { "default": mod };
24210
+ };
24211
+ var events_1 = __require("events");
24212
+ var debug_1 = __importDefault(require_src());
24213
+ var promisify_1 = __importDefault(require_promisify());
24214
+ var debug = debug_1.default("agent-base");
24215
+ function isAgent(v) {
24216
+ return Boolean(v) && typeof v.addRequest === "function";
24217
+ }
24218
+ function isSecureEndpoint() {
24219
+ const { stack } = new Error();
24220
+ if (typeof stack !== "string")
24221
+ return false;
24222
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
24223
+ }
24224
+ function createAgent(callback, opts) {
24225
+ return new createAgent.Agent(callback, opts);
24226
+ }
24227
+ (function(createAgent2) {
24228
+ class Agent extends events_1.EventEmitter {
24229
+ constructor(callback, _opts) {
24230
+ super();
24231
+ let opts = _opts;
24232
+ if (typeof callback === "function") {
24233
+ this.callback = callback;
24234
+ } else if (callback) {
24235
+ opts = callback;
24236
+ }
24237
+ this.timeout = null;
24238
+ if (opts && typeof opts.timeout === "number") {
24239
+ this.timeout = opts.timeout;
24240
+ }
24241
+ this.maxFreeSockets = 1;
24242
+ this.maxSockets = 1;
24243
+ this.maxTotalSockets = Infinity;
24244
+ this.sockets = {};
24245
+ this.freeSockets = {};
24246
+ this.requests = {};
24247
+ this.options = {};
24248
+ }
24249
+ get defaultPort() {
24250
+ if (typeof this.explicitDefaultPort === "number") {
24251
+ return this.explicitDefaultPort;
24252
+ }
24253
+ return isSecureEndpoint() ? 443 : 80;
24254
+ }
24255
+ set defaultPort(v) {
24256
+ this.explicitDefaultPort = v;
24257
+ }
24258
+ get protocol() {
24259
+ if (typeof this.explicitProtocol === "string") {
24260
+ return this.explicitProtocol;
24261
+ }
24262
+ return isSecureEndpoint() ? "https:" : "http:";
24263
+ }
24264
+ set protocol(v) {
24265
+ this.explicitProtocol = v;
24266
+ }
24267
+ callback(req, opts, fn) {
24268
+ throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
24269
+ }
24270
+ /**
24271
+ * Called by node-core's "_http_client.js" module when creating
24272
+ * a new HTTP request with this Agent instance.
24273
+ *
24274
+ * @api public
24275
+ */
24276
+ addRequest(req, _opts) {
24277
+ const opts = Object.assign({}, _opts);
24278
+ if (typeof opts.secureEndpoint !== "boolean") {
24279
+ opts.secureEndpoint = isSecureEndpoint();
24280
+ }
24281
+ if (opts.host == null) {
24282
+ opts.host = "localhost";
24283
+ }
24284
+ if (opts.port == null) {
24285
+ opts.port = opts.secureEndpoint ? 443 : 80;
24286
+ }
24287
+ if (opts.protocol == null) {
24288
+ opts.protocol = opts.secureEndpoint ? "https:" : "http:";
24289
+ }
24290
+ if (opts.host && opts.path) {
24291
+ delete opts.path;
24292
+ }
24293
+ delete opts.agent;
24294
+ delete opts.hostname;
24295
+ delete opts._defaultAgent;
24296
+ delete opts.defaultPort;
24297
+ delete opts.createConnection;
24298
+ req._last = true;
24299
+ req.shouldKeepAlive = false;
24300
+ let timedOut = false;
24301
+ let timeoutId = null;
24302
+ const timeoutMs = opts.timeout || this.timeout;
24303
+ const onerror = (err) => {
24304
+ if (req._hadError)
24305
+ return;
24306
+ req.emit("error", err);
24307
+ req._hadError = true;
24308
+ };
24309
+ const ontimeout = () => {
24310
+ timeoutId = null;
24311
+ timedOut = true;
24312
+ const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
24313
+ err.code = "ETIMEOUT";
24314
+ onerror(err);
24315
+ };
24316
+ const callbackError = (err) => {
24317
+ if (timedOut)
24318
+ return;
24319
+ if (timeoutId !== null) {
24320
+ clearTimeout(timeoutId);
24321
+ timeoutId = null;
24322
+ }
24323
+ onerror(err);
24324
+ };
24325
+ const onsocket = (socket) => {
24326
+ if (timedOut)
24327
+ return;
24328
+ if (timeoutId != null) {
24329
+ clearTimeout(timeoutId);
24330
+ timeoutId = null;
24331
+ }
24332
+ if (isAgent(socket)) {
24333
+ debug("Callback returned another Agent instance %o", socket.constructor.name);
24334
+ socket.addRequest(req, opts);
24335
+ return;
24336
+ }
24337
+ if (socket) {
24338
+ socket.once("free", () => {
24339
+ this.freeSocket(socket, opts);
24340
+ });
24341
+ req.onSocket(socket);
24342
+ return;
24343
+ }
24344
+ const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
24345
+ onerror(err);
24346
+ };
24347
+ if (typeof this.callback !== "function") {
24348
+ onerror(new Error("`callback` is not defined"));
24349
+ return;
24350
+ }
24351
+ if (!this.promisifiedCallback) {
24352
+ if (this.callback.length >= 3) {
24353
+ debug("Converting legacy callback function to promise");
24354
+ this.promisifiedCallback = promisify_1.default(this.callback);
24355
+ } else {
24356
+ this.promisifiedCallback = this.callback;
24357
+ }
24358
+ }
24359
+ if (typeof timeoutMs === "number" && timeoutMs > 0) {
24360
+ timeoutId = setTimeout(ontimeout, timeoutMs);
24361
+ }
24362
+ if ("port" in opts && typeof opts.port !== "number") {
24363
+ opts.port = Number(opts.port);
24364
+ }
24365
+ try {
24366
+ debug("Resolving socket for %o request: %o", opts.protocol, `${req.method} ${req.path}`);
24367
+ Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
24368
+ } catch (err) {
24369
+ Promise.reject(err).catch(callbackError);
24370
+ }
24371
+ }
24372
+ freeSocket(socket, opts) {
24373
+ debug("Freeing socket %o %o", socket.constructor.name, opts);
24374
+ socket.destroy();
24375
+ }
24376
+ destroy() {
24377
+ debug("Destroying agent %o", this.constructor.name);
24378
+ }
24379
+ }
24380
+ createAgent2.Agent = Agent;
24381
+ createAgent2.prototype = createAgent2.Agent.prototype;
24382
+ })(createAgent || (createAgent = {}));
24383
+ module.exports = createAgent;
24384
+ }
24385
+ });
24386
+
24387
+ // node_modules/https-proxy-agent/dist/parse-proxy-response.js
24388
+ var require_parse_proxy_response = __commonJS({
24389
+ "node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports) {
24390
+ "use strict";
24391
+ var __importDefault = exports && exports.__importDefault || function(mod) {
24392
+ return mod && mod.__esModule ? mod : { "default": mod };
24393
+ };
24394
+ Object.defineProperty(exports, "__esModule", { value: true });
24395
+ var debug_1 = __importDefault(require_src());
24396
+ var debug = debug_1.default("https-proxy-agent:parse-proxy-response");
24397
+ function parseProxyResponse(socket) {
24398
+ return new Promise((resolve, reject) => {
24399
+ let buffersLength = 0;
24400
+ const buffers = [];
24401
+ function read() {
24402
+ const b = socket.read();
24403
+ if (b)
24404
+ ondata(b);
24405
+ else
24406
+ socket.once("readable", read);
24407
+ }
24408
+ function cleanup() {
24409
+ socket.removeListener("end", onend);
24410
+ socket.removeListener("error", onerror);
24411
+ socket.removeListener("close", onclose);
24412
+ socket.removeListener("readable", read);
24413
+ }
24414
+ function onclose(err) {
24415
+ debug("onclose had error %o", err);
24416
+ }
24417
+ function onend() {
24418
+ debug("onend");
24419
+ }
24420
+ function onerror(err) {
24421
+ cleanup();
24422
+ debug("onerror %o", err);
24423
+ reject(err);
24424
+ }
24425
+ function ondata(b) {
24426
+ buffers.push(b);
24427
+ buffersLength += b.length;
24428
+ const buffered = Buffer.concat(buffers, buffersLength);
24429
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
24430
+ if (endOfHeaders === -1) {
24431
+ debug("have not received end of HTTP headers yet...");
24432
+ read();
24433
+ return;
24434
+ }
24435
+ const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
24436
+ const statusCode = +firstLine.split(" ")[1];
24437
+ debug("got proxy server response: %o", firstLine);
24438
+ resolve({
24439
+ statusCode,
24440
+ buffered
24441
+ });
24442
+ }
24443
+ socket.on("error", onerror);
24444
+ socket.on("close", onclose);
24445
+ socket.on("end", onend);
24446
+ read();
24447
+ });
24448
+ }
24449
+ exports.default = parseProxyResponse;
24450
+ }
24451
+ });
24452
+
24453
+ // node_modules/https-proxy-agent/dist/agent.js
24454
+ var require_agent = __commonJS({
24455
+ "node_modules/https-proxy-agent/dist/agent.js"(exports) {
24456
+ "use strict";
24457
+ var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
24458
+ function adopt(value) {
24459
+ return value instanceof P ? value : new P(function(resolve) {
24460
+ resolve(value);
24461
+ });
24462
+ }
24463
+ return new (P || (P = Promise))(function(resolve, reject) {
24464
+ function fulfilled(value) {
24465
+ try {
24466
+ step(generator.next(value));
24467
+ } catch (e) {
24468
+ reject(e);
24469
+ }
24470
+ }
24471
+ function rejected(value) {
24472
+ try {
24473
+ step(generator["throw"](value));
24474
+ } catch (e) {
24475
+ reject(e);
24476
+ }
24477
+ }
24478
+ function step(result) {
24479
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
24480
+ }
24481
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24482
+ });
24483
+ };
24484
+ var __importDefault = exports && exports.__importDefault || function(mod) {
24485
+ return mod && mod.__esModule ? mod : { "default": mod };
24486
+ };
24487
+ Object.defineProperty(exports, "__esModule", { value: true });
24488
+ var net_1 = __importDefault(__require("net"));
24489
+ var tls_1 = __importDefault(__require("tls"));
24490
+ var url_1 = __importDefault(__require("url"));
24491
+ var assert_1 = __importDefault(__require("assert"));
24492
+ var debug_1 = __importDefault(require_src());
24493
+ var agent_base_1 = require_src2();
24494
+ var parse_proxy_response_1 = __importDefault(require_parse_proxy_response());
24495
+ var debug = debug_1.default("https-proxy-agent:agent");
24496
+ var HttpsProxyAgent = class extends agent_base_1.Agent {
24497
+ constructor(_opts) {
24498
+ let opts;
24499
+ if (typeof _opts === "string") {
24500
+ opts = url_1.default.parse(_opts);
24501
+ } else {
24502
+ opts = _opts;
24503
+ }
24504
+ if (!opts) {
24505
+ throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");
24506
+ }
24507
+ debug("creating new HttpsProxyAgent instance: %o", opts);
24508
+ super(opts);
24509
+ const proxy = Object.assign({}, opts);
24510
+ this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
24511
+ proxy.host = proxy.hostname || proxy.host;
24512
+ if (typeof proxy.port === "string") {
24513
+ proxy.port = parseInt(proxy.port, 10);
24514
+ }
24515
+ if (!proxy.port && proxy.host) {
24516
+ proxy.port = this.secureProxy ? 443 : 80;
24517
+ }
24518
+ if (this.secureProxy && !("ALPNProtocols" in proxy)) {
24519
+ proxy.ALPNProtocols = ["http 1.1"];
24520
+ }
24521
+ if (proxy.host && proxy.path) {
24522
+ delete proxy.path;
24523
+ delete proxy.pathname;
24524
+ }
24525
+ this.proxy = proxy;
24526
+ }
24527
+ /**
24528
+ * Called when the node-core HTTP client library is creating a
24529
+ * new HTTP request.
24530
+ *
24531
+ * @api protected
24532
+ */
24533
+ callback(req, opts) {
24534
+ return __awaiter(this, void 0, void 0, function* () {
24535
+ const { proxy, secureProxy } = this;
24536
+ let socket;
24537
+ if (secureProxy) {
24538
+ debug("Creating `tls.Socket`: %o", proxy);
24539
+ socket = tls_1.default.connect(proxy);
24540
+ } else {
24541
+ debug("Creating `net.Socket`: %o", proxy);
24542
+ socket = net_1.default.connect(proxy);
24543
+ }
24544
+ const headers = Object.assign({}, proxy.headers);
24545
+ const hostname = `${opts.host}:${opts.port}`;
24546
+ let payload = `CONNECT ${hostname} HTTP/1.1\r
24547
+ `;
24548
+ if (proxy.auth) {
24549
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(proxy.auth).toString("base64")}`;
24550
+ }
24551
+ let { host, port, secureEndpoint } = opts;
24552
+ if (!isDefaultPort(port, secureEndpoint)) {
24553
+ host += `:${port}`;
24554
+ }
24555
+ headers.Host = host;
24556
+ headers.Connection = "close";
24557
+ for (const name of Object.keys(headers)) {
24558
+ payload += `${name}: ${headers[name]}\r
24559
+ `;
24560
+ }
24561
+ const proxyResponsePromise = parse_proxy_response_1.default(socket);
24562
+ socket.write(`${payload}\r
24563
+ `);
24564
+ const { statusCode, buffered } = yield proxyResponsePromise;
24565
+ if (statusCode === 200) {
24566
+ req.once("socket", resume);
24567
+ if (opts.secureEndpoint) {
24568
+ debug("Upgrading socket connection to TLS");
24569
+ const servername = opts.servername || opts.host;
24570
+ return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, "host", "hostname", "path", "port")), {
24571
+ socket,
24572
+ servername
24573
+ }));
24574
+ }
24575
+ return socket;
24576
+ }
24577
+ socket.destroy();
24578
+ const fakeSocket = new net_1.default.Socket({ writable: false });
24579
+ fakeSocket.readable = true;
24580
+ req.once("socket", (s) => {
24581
+ debug("replaying proxy buffer for failed request");
24582
+ assert_1.default(s.listenerCount("data") > 0);
24583
+ s.push(buffered);
24584
+ s.push(null);
24585
+ });
24586
+ return fakeSocket;
24587
+ });
24588
+ }
24589
+ };
24590
+ exports.default = HttpsProxyAgent;
24591
+ function resume(socket) {
24592
+ socket.resume();
24593
+ }
24594
+ function isDefaultPort(port, secure) {
24595
+ return Boolean(!secure && port === 80 || secure && port === 443);
24596
+ }
24597
+ function isHTTPS(protocol) {
24598
+ return typeof protocol === "string" ? /^https:?$/i.test(protocol) : false;
24599
+ }
24600
+ function omit(obj, ...keys) {
24601
+ const ret = {};
24602
+ let key;
24603
+ for (key in obj) {
24604
+ if (!keys.includes(key)) {
24605
+ ret[key] = obj[key];
24606
+ }
24607
+ }
24608
+ return ret;
24609
+ }
24610
+ }
24611
+ });
24612
+
24613
+ // node_modules/https-proxy-agent/dist/index.js
24614
+ var require_dist = __commonJS({
24615
+ "node_modules/https-proxy-agent/dist/index.js"(exports, module) {
24616
+ "use strict";
24617
+ var __importDefault = exports && exports.__importDefault || function(mod) {
24618
+ return mod && mod.__esModule ? mod : { "default": mod };
24619
+ };
24620
+ var agent_1 = __importDefault(require_agent());
24621
+ function createHttpsProxyAgent(opts) {
24622
+ return new agent_1.default(opts);
24623
+ }
24624
+ (function(createHttpsProxyAgent2) {
24625
+ createHttpsProxyAgent2.HttpsProxyAgent = agent_1.default;
24626
+ createHttpsProxyAgent2.prototype = agent_1.default.prototype;
24627
+ })(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
24628
+ module.exports = createHttpsProxyAgent;
24629
+ }
24630
+ });
24631
+
24182
24632
  // node_modules/follow-redirects/debug.js
24183
24633
  var require_debug = __commonJS({
24184
24634
  "node_modules/follow-redirects/debug.js"(exports, module) {
@@ -24719,6 +25169,7 @@ var require_axios = __commonJS({
24719
25169
  var FormData$1 = require_form_data();
24720
25170
  var crypto = __require("crypto");
24721
25171
  var url = __require("url");
25172
+ var HttpsProxyAgent = require_dist();
24722
25173
  var http = __require("http");
24723
25174
  var https = __require("https");
24724
25175
  var http2 = __require("http2");
@@ -24873,7 +25324,7 @@ var require_axios = __commonJS({
24873
25324
  return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
24874
25325
  })();
24875
25326
  var isContextDefined = (context) => !isUndefined(context) && context !== _global;
24876
- function merge() {
25327
+ function merge(...objs) {
24877
25328
  const {
24878
25329
  caseless,
24879
25330
  skipUndefined
@@ -24884,8 +25335,9 @@ var require_axios = __commonJS({
24884
25335
  return;
24885
25336
  }
24886
25337
  const targetKey = caseless && findKey(result, key) || key;
24887
- if (isPlainObject2(result[targetKey]) && isPlainObject2(val)) {
24888
- result[targetKey] = merge(result[targetKey], val);
25338
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
25339
+ if (isPlainObject2(existing) && isPlainObject2(val)) {
25340
+ result[targetKey] = merge(existing, val);
24889
25341
  } else if (isPlainObject2(val)) {
24890
25342
  result[targetKey] = merge({}, val);
24891
25343
  } else if (isArray(val)) {
@@ -24894,8 +25346,8 @@ var require_axios = __commonJS({
24894
25346
  result[targetKey] = val;
24895
25347
  }
24896
25348
  };
24897
- for (let i = 0, l = arguments.length; i < l; i++) {
24898
- arguments[i] && forEach(arguments[i], assignValue);
25349
+ for (let i = 0, l = objs.length; i < l; i++) {
25350
+ objs[i] && forEach(objs[i], assignValue);
24899
25351
  }
24900
25352
  return result;
24901
25353
  }
@@ -24905,6 +25357,9 @@ var require_axios = __commonJS({
24905
25357
  forEach(b, (val, key) => {
24906
25358
  if (thisArg && isFunction$1(val)) {
24907
25359
  Object.defineProperty(a, key, {
25360
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
25361
+ // hijack defineProperty's accessor-vs-data resolution.
25362
+ __proto__: null,
24908
25363
  value: bind(val, thisArg),
24909
25364
  writable: true,
24910
25365
  enumerable: true,
@@ -24912,6 +25367,7 @@ var require_axios = __commonJS({
24912
25367
  });
24913
25368
  } else {
24914
25369
  Object.defineProperty(a, key, {
25370
+ __proto__: null,
24915
25371
  value: val,
24916
25372
  writable: true,
24917
25373
  enumerable: true,
@@ -24932,12 +25388,14 @@ var require_axios = __commonJS({
24932
25388
  var inherits = (constructor, superConstructor, props, descriptors) => {
24933
25389
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
24934
25390
  Object.defineProperty(constructor.prototype, "constructor", {
25391
+ __proto__: null,
24935
25392
  value: constructor,
24936
25393
  writable: true,
24937
25394
  enumerable: false,
24938
25395
  configurable: true
24939
25396
  });
24940
25397
  Object.defineProperty(constructor, "super", {
25398
+ __proto__: null,
24941
25399
  value: superConstructor.prototype
24942
25400
  });
24943
25401
  props && Object.assign(constructor.prototype, props);
@@ -25028,7 +25486,7 @@ var require_axios = __commonJS({
25028
25486
  };
25029
25487
  var freezeMethods = (obj) => {
25030
25488
  reduceDescriptors(obj, (descriptor, name) => {
25031
- if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
25489
+ if (isFunction$1(obj) && ["arguments", "caller", "callee"].includes(name)) {
25032
25490
  return false;
25033
25491
  }
25034
25492
  const value = obj[name];
@@ -25064,29 +25522,29 @@ var require_axios = __commonJS({
25064
25522
  return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
25065
25523
  }
25066
25524
  var toJSONObject = (obj) => {
25067
- const stack = new Array(10);
25068
- const visit = (source, i) => {
25525
+ const visited = /* @__PURE__ */ new WeakSet();
25526
+ const visit = (source) => {
25069
25527
  if (isObject(source)) {
25070
- if (stack.indexOf(source) >= 0) {
25528
+ if (visited.has(source)) {
25071
25529
  return;
25072
25530
  }
25073
25531
  if (isBuffer(source)) {
25074
25532
  return source;
25075
25533
  }
25076
25534
  if (!("toJSON" in source)) {
25077
- stack[i] = source;
25535
+ visited.add(source);
25078
25536
  const target = isArray(source) ? [] : {};
25079
25537
  forEach(source, (value, key) => {
25080
- const reducedValue = visit(value, i + 1);
25538
+ const reducedValue = visit(value);
25081
25539
  !isUndefined(reducedValue) && (target[key] = reducedValue);
25082
25540
  });
25083
- stack[i] = void 0;
25541
+ visited.delete(source);
25084
25542
  return target;
25085
25543
  }
25086
25544
  }
25087
25545
  return source;
25088
25546
  };
25089
- return visit(obj, 0);
25547
+ return visit(obj);
25090
25548
  };
25091
25549
  var isAsyncFn = kindOfTest("AsyncFunction");
25092
25550
  var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
@@ -25173,814 +25631,889 @@ var require_axios = __commonJS({
25173
25631
  asap,
25174
25632
  isIterable
25175
25633
  };
25176
- var AxiosError = class _AxiosError extends Error {
25177
- static from(error, code, config, request, response, customProps) {
25178
- const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
25179
- axiosError.cause = error;
25180
- axiosError.name = error.name;
25181
- if (error.status != null && axiosError.status == null) {
25182
- axiosError.status = error.status;
25634
+ var ignoreDuplicateOf = utils$1.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]);
25635
+ var parseHeaders = (rawHeaders) => {
25636
+ const parsed = {};
25637
+ let key;
25638
+ let val;
25639
+ let i;
25640
+ rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
25641
+ i = line.indexOf(":");
25642
+ key = line.substring(0, i).trim().toLowerCase();
25643
+ val = line.substring(i + 1).trim();
25644
+ if (!key || parsed[key] && ignoreDuplicateOf[key]) {
25645
+ return;
25183
25646
  }
25184
- customProps && Object.assign(axiosError, customProps);
25185
- return axiosError;
25647
+ if (key === "set-cookie") {
25648
+ if (parsed[key]) {
25649
+ parsed[key].push(val);
25650
+ } else {
25651
+ parsed[key] = [val];
25652
+ }
25653
+ } else {
25654
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
25655
+ }
25656
+ });
25657
+ return parsed;
25658
+ };
25659
+ function trimSPorHTAB(str) {
25660
+ let start = 0;
25661
+ let end = str.length;
25662
+ while (start < end) {
25663
+ const code = str.charCodeAt(start);
25664
+ if (code !== 9 && code !== 32) {
25665
+ break;
25666
+ }
25667
+ start += 1;
25186
25668
  }
25187
- /**
25188
- * Create an Error with the specified message, config, error code, request and response.
25189
- *
25190
- * @param {string} message The error message.
25191
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
25192
- * @param {Object} [config] The config.
25193
- * @param {Object} [request] The request.
25194
- * @param {Object} [response] The response.
25195
- *
25196
- * @returns {Error} The created error.
25197
- */
25198
- constructor(message, code, config, request, response) {
25199
- super(message);
25200
- Object.defineProperty(this, "message", {
25201
- value: message,
25202
- enumerable: true,
25203
- writable: true,
25204
- configurable: true
25205
- });
25206
- this.name = "AxiosError";
25207
- this.isAxiosError = true;
25208
- code && (this.code = code);
25209
- config && (this.config = config);
25210
- request && (this.request = request);
25211
- if (response) {
25212
- this.response = response;
25213
- this.status = response.status;
25669
+ while (end > start) {
25670
+ const code = str.charCodeAt(end - 1);
25671
+ if (code !== 9 && code !== 32) {
25672
+ break;
25214
25673
  }
25674
+ end -= 1;
25215
25675
  }
25216
- toJSON() {
25217
- return {
25218
- // Standard
25219
- message: this.message,
25220
- name: this.name,
25221
- // Microsoft
25222
- description: this.description,
25223
- number: this.number,
25224
- // Mozilla
25225
- fileName: this.fileName,
25226
- lineNumber: this.lineNumber,
25227
- columnNumber: this.columnNumber,
25228
- stack: this.stack,
25229
- // Axios
25230
- config: utils$1.toJSONObject(this.config),
25231
- code: this.code,
25232
- status: this.status
25233
- };
25676
+ return start === 0 && end === str.length ? str : str.slice(start, end);
25677
+ }
25678
+ var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g");
25679
+ var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
25680
+ function sanitizeValue(value, invalidChars) {
25681
+ if (utils$1.isArray(value)) {
25682
+ return value.map((item) => sanitizeValue(item, invalidChars));
25234
25683
  }
25235
- };
25236
- AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
25237
- AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
25238
- AxiosError.ECONNABORTED = "ECONNABORTED";
25239
- AxiosError.ETIMEDOUT = "ETIMEDOUT";
25240
- AxiosError.ERR_NETWORK = "ERR_NETWORK";
25241
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
25242
- AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
25243
- AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
25244
- AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
25245
- AxiosError.ERR_CANCELED = "ERR_CANCELED";
25246
- AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
25247
- AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
25248
- AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
25249
- function isVisitable(thing) {
25250
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
25684
+ return trimSPorHTAB(String(value).replace(invalidChars, ""));
25251
25685
  }
25252
- function removeBrackets(key) {
25253
- return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
25686
+ var sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
25687
+ var sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
25688
+ function toByteStringHeaderObject(headers) {
25689
+ const byteStringHeaders = /* @__PURE__ */ Object.create(null);
25690
+ utils$1.forEach(headers.toJSON(), (value, header) => {
25691
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
25692
+ });
25693
+ return byteStringHeaders;
25254
25694
  }
25255
- function renderKey(path2, key, dots) {
25256
- if (!path2) return key;
25257
- return path2.concat(key).map(function each(token2, i) {
25258
- token2 = removeBrackets(token2);
25259
- return !dots && i ? "[" + token2 + "]" : token2;
25260
- }).join(dots ? "." : "");
25695
+ var $internals = /* @__PURE__ */ Symbol("internals");
25696
+ function normalizeHeader(header) {
25697
+ return header && String(header).trim().toLowerCase();
25261
25698
  }
25262
- function isFlatArray(arr) {
25263
- return utils$1.isArray(arr) && !arr.some(isVisitable);
25699
+ function normalizeValue(value) {
25700
+ if (value === false || value == null) {
25701
+ return value;
25702
+ }
25703
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
25264
25704
  }
25265
- var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
25266
- return /^is[A-Z]/.test(prop);
25267
- });
25268
- function toFormData(obj, formData, options) {
25269
- if (!utils$1.isObject(obj)) {
25270
- throw new TypeError("target must be an object");
25705
+ function parseTokens(str) {
25706
+ const tokens = /* @__PURE__ */ Object.create(null);
25707
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
25708
+ let match2;
25709
+ while (match2 = tokensRE.exec(str)) {
25710
+ tokens[match2[1]] = match2[2];
25271
25711
  }
25272
- formData = formData || new (FormData$1 || FormData)();
25273
- options = utils$1.toFlatObject(options, {
25274
- metaTokens: true,
25275
- dots: false,
25276
- indexes: false
25277
- }, false, function defined(option, source) {
25278
- return !utils$1.isUndefined(source[option]);
25712
+ return tokens;
25713
+ }
25714
+ var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
25715
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
25716
+ if (utils$1.isFunction(filter)) {
25717
+ return filter.call(this, value, header);
25718
+ }
25719
+ if (isHeaderNameFilter) {
25720
+ value = header;
25721
+ }
25722
+ if (!utils$1.isString(value)) return;
25723
+ if (utils$1.isString(filter)) {
25724
+ return value.indexOf(filter) !== -1;
25725
+ }
25726
+ if (utils$1.isRegExp(filter)) {
25727
+ return filter.test(value);
25728
+ }
25729
+ }
25730
+ function formatHeader(header) {
25731
+ return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
25732
+ return char.toUpperCase() + str;
25279
25733
  });
25280
- const metaTokens = options.metaTokens;
25281
- const visitor = options.visitor || defaultVisitor;
25282
- const dots = options.dots;
25283
- const indexes = options.indexes;
25284
- const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
25285
- const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
25286
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
25287
- if (!utils$1.isFunction(visitor)) {
25288
- throw new TypeError("visitor must be a function");
25734
+ }
25735
+ function buildAccessors(obj, header) {
25736
+ const accessorName = utils$1.toCamelCase(" " + header);
25737
+ ["get", "set", "has"].forEach((methodName) => {
25738
+ Object.defineProperty(obj, methodName + accessorName, {
25739
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
25740
+ // this data descriptor into an accessor descriptor on the way in.
25741
+ __proto__: null,
25742
+ value: function(arg1, arg2, arg3) {
25743
+ return this[methodName].call(this, header, arg1, arg2, arg3);
25744
+ },
25745
+ configurable: true
25746
+ });
25747
+ });
25748
+ }
25749
+ var AxiosHeaders = class {
25750
+ constructor(headers) {
25751
+ headers && this.set(headers);
25289
25752
  }
25290
- function convertValue(value) {
25291
- if (value === null) return "";
25292
- if (utils$1.isDate(value)) {
25293
- return value.toISOString();
25294
- }
25295
- if (utils$1.isBoolean(value)) {
25296
- return value.toString();
25297
- }
25298
- if (!useBlob && utils$1.isBlob(value)) {
25299
- throw new AxiosError("Blob is not supported. Use a Buffer instead.");
25753
+ set(header, valueOrRewrite, rewrite) {
25754
+ const self2 = this;
25755
+ function setHeader(_value, _header, _rewrite) {
25756
+ const lHeader = normalizeHeader(_header);
25757
+ if (!lHeader) {
25758
+ throw new Error("header name must be a non-empty string");
25759
+ }
25760
+ const key = utils$1.findKey(self2, lHeader);
25761
+ if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
25762
+ self2[key || _header] = normalizeValue(_value);
25763
+ }
25300
25764
  }
25301
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
25302
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
25765
+ const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
25766
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
25767
+ setHeaders(header, valueOrRewrite);
25768
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
25769
+ setHeaders(parseHeaders(header), valueOrRewrite);
25770
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
25771
+ let obj = {}, dest, key;
25772
+ for (const entry of header) {
25773
+ if (!utils$1.isArray(entry)) {
25774
+ throw TypeError("Object iterator must return a key-value pair");
25775
+ }
25776
+ obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
25777
+ }
25778
+ setHeaders(obj, valueOrRewrite);
25779
+ } else {
25780
+ header != null && setHeader(valueOrRewrite, header, rewrite);
25303
25781
  }
25304
- return value;
25782
+ return this;
25305
25783
  }
25306
- function defaultVisitor(value, key, path2) {
25307
- let arr = value;
25308
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
25309
- formData.append(renderKey(path2, key, dots), convertValue(value));
25310
- return false;
25311
- }
25312
- if (value && !path2 && typeof value === "object") {
25313
- if (utils$1.endsWith(key, "{}")) {
25314
- key = metaTokens ? key : key.slice(0, -2);
25315
- value = JSON.stringify(value);
25316
- } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
25317
- key = removeBrackets(key);
25318
- arr.forEach(function each(el, index) {
25319
- !(utils$1.isUndefined(el) || el === null) && formData.append(
25320
- // eslint-disable-next-line no-nested-ternary
25321
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
25322
- convertValue(el)
25323
- );
25324
- });
25325
- return false;
25784
+ get(header, parser) {
25785
+ header = normalizeHeader(header);
25786
+ if (header) {
25787
+ const key = utils$1.findKey(this, header);
25788
+ if (key) {
25789
+ const value = this[key];
25790
+ if (!parser) {
25791
+ return value;
25792
+ }
25793
+ if (parser === true) {
25794
+ return parseTokens(value);
25795
+ }
25796
+ if (utils$1.isFunction(parser)) {
25797
+ return parser.call(this, value, key);
25798
+ }
25799
+ if (utils$1.isRegExp(parser)) {
25800
+ return parser.exec(value);
25801
+ }
25802
+ throw new TypeError("parser must be boolean|regexp|function");
25326
25803
  }
25327
25804
  }
25328
- if (isVisitable(value)) {
25329
- return true;
25805
+ }
25806
+ has(header, matcher) {
25807
+ header = normalizeHeader(header);
25808
+ if (header) {
25809
+ const key = utils$1.findKey(this, header);
25810
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
25330
25811
  }
25331
- formData.append(renderKey(path2, key, dots), convertValue(value));
25332
25812
  return false;
25333
25813
  }
25334
- const stack = [];
25335
- const exposedHelpers = Object.assign(predicates, {
25336
- defaultVisitor,
25337
- convertValue,
25338
- isVisitable
25339
- });
25340
- function build(value, path2, depth = 0) {
25341
- if (utils$1.isUndefined(value)) return;
25342
- if (depth > maxDepth) {
25343
- throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
25814
+ delete(header, matcher) {
25815
+ const self2 = this;
25816
+ let deleted = false;
25817
+ function deleteHeader(_header) {
25818
+ _header = normalizeHeader(_header);
25819
+ if (_header) {
25820
+ const key = utils$1.findKey(self2, _header);
25821
+ if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
25822
+ delete self2[key];
25823
+ deleted = true;
25824
+ }
25825
+ }
25344
25826
  }
25345
- if (stack.indexOf(value) !== -1) {
25346
- throw Error("Circular reference detected in " + path2.join("."));
25827
+ if (utils$1.isArray(header)) {
25828
+ header.forEach(deleteHeader);
25829
+ } else {
25830
+ deleteHeader(header);
25347
25831
  }
25348
- stack.push(value);
25349
- utils$1.forEach(value, function each(el, key) {
25350
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path2, exposedHelpers);
25351
- if (result === true) {
25352
- build(el, path2 ? path2.concat(key) : [key], depth + 1);
25832
+ return deleted;
25833
+ }
25834
+ clear(matcher) {
25835
+ const keys = Object.keys(this);
25836
+ let i = keys.length;
25837
+ let deleted = false;
25838
+ while (i--) {
25839
+ const key = keys[i];
25840
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
25841
+ delete this[key];
25842
+ deleted = true;
25843
+ }
25844
+ }
25845
+ return deleted;
25846
+ }
25847
+ normalize(format2) {
25848
+ const self2 = this;
25849
+ const headers = {};
25850
+ utils$1.forEach(this, (value, header) => {
25851
+ const key = utils$1.findKey(headers, header);
25852
+ if (key) {
25853
+ self2[key] = normalizeValue(value);
25854
+ delete self2[header];
25855
+ return;
25353
25856
  }
25857
+ const normalized = format2 ? formatHeader(header) : String(header).trim();
25858
+ if (normalized !== header) {
25859
+ delete self2[header];
25860
+ }
25861
+ self2[normalized] = normalizeValue(value);
25862
+ headers[normalized] = true;
25354
25863
  });
25355
- stack.pop();
25864
+ return this;
25356
25865
  }
25357
- if (!utils$1.isObject(obj)) {
25358
- throw new TypeError("data must be an object");
25866
+ concat(...targets) {
25867
+ return this.constructor.concat(this, ...targets);
25359
25868
  }
25360
- build(obj);
25361
- return formData;
25362
- }
25363
- function encode$1(str) {
25364
- const charMap = {
25365
- "!": "%21",
25366
- "'": "%27",
25367
- "(": "%28",
25368
- ")": "%29",
25369
- "~": "%7E",
25370
- "%20": "+"
25371
- };
25372
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match2) {
25373
- return charMap[match2];
25374
- });
25375
- }
25376
- function AxiosURLSearchParams(params, options) {
25377
- this._pairs = [];
25378
- params && toFormData(params, this, options);
25379
- }
25380
- var prototype = AxiosURLSearchParams.prototype;
25381
- prototype.append = function append(name, value) {
25382
- this._pairs.push([name, value]);
25383
- };
25384
- prototype.toString = function toString3(encoder) {
25385
- const _encode = encoder ? function(value) {
25386
- return encoder.call(this, value, encode$1);
25387
- } : encode$1;
25388
- return this._pairs.map(function each(pair) {
25389
- return _encode(pair[0]) + "=" + _encode(pair[1]);
25390
- }, "").join("&");
25391
- };
25392
- function encode(val) {
25393
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
25394
- }
25395
- function buildURL(url2, params, options) {
25396
- if (!params) {
25397
- return url2;
25869
+ toJSON(asStrings) {
25870
+ const obj = /* @__PURE__ */ Object.create(null);
25871
+ utils$1.forEach(this, (value, header) => {
25872
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
25873
+ });
25874
+ return obj;
25398
25875
  }
25399
- const _encode = options && options.encode || encode;
25400
- const _options = utils$1.isFunction(options) ? {
25401
- serialize: options
25402
- } : options;
25403
- const serializeFn = _options && _options.serialize;
25404
- let serializedParams;
25405
- if (serializeFn) {
25406
- serializedParams = serializeFn(params, _options);
25407
- } else {
25408
- serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
25876
+ [Symbol.iterator]() {
25877
+ return Object.entries(this.toJSON())[Symbol.iterator]();
25409
25878
  }
25410
- if (serializedParams) {
25411
- const hashmarkIndex = url2.indexOf("#");
25412
- if (hashmarkIndex !== -1) {
25413
- url2 = url2.slice(0, hashmarkIndex);
25414
- }
25415
- url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
25879
+ toString() {
25880
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
25416
25881
  }
25417
- return url2;
25418
- }
25419
- var InterceptorManager = class {
25420
- constructor() {
25421
- this.handlers = [];
25882
+ getSetCookie() {
25883
+ return this.get("set-cookie") || [];
25422
25884
  }
25423
- /**
25424
- * Add a new interceptor to the stack
25425
- *
25426
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
25427
- * @param {Function} rejected The function to handle `reject` for a `Promise`
25428
- * @param {Object} options The options for the interceptor, synchronous and runWhen
25429
- *
25430
- * @return {Number} An ID used to remove interceptor later
25431
- */
25432
- use(fulfilled, rejected, options) {
25433
- this.handlers.push({
25434
- fulfilled,
25435
- rejected,
25436
- synchronous: options ? options.synchronous : false,
25437
- runWhen: options ? options.runWhen : null
25438
- });
25439
- return this.handlers.length - 1;
25885
+ get [Symbol.toStringTag]() {
25886
+ return "AxiosHeaders";
25440
25887
  }
25441
- /**
25442
- * Remove an interceptor from the stack
25443
- *
25444
- * @param {Number} id The ID that was returned by `use`
25445
- *
25446
- * @returns {void}
25447
- */
25448
- eject(id) {
25449
- if (this.handlers[id]) {
25450
- this.handlers[id] = null;
25888
+ static from(thing) {
25889
+ return thing instanceof this ? thing : new this(thing);
25890
+ }
25891
+ static concat(first2, ...targets) {
25892
+ const computed = new this(first2);
25893
+ targets.forEach((target) => computed.set(target));
25894
+ return computed;
25895
+ }
25896
+ static accessor(header) {
25897
+ const internals = this[$internals] = this[$internals] = {
25898
+ accessors: {}
25899
+ };
25900
+ const accessors = internals.accessors;
25901
+ const prototype2 = this.prototype;
25902
+ function defineAccessor(_header) {
25903
+ const lHeader = normalizeHeader(_header);
25904
+ if (!accessors[lHeader]) {
25905
+ buildAccessors(prototype2, _header);
25906
+ accessors[lHeader] = true;
25907
+ }
25451
25908
  }
25909
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
25910
+ return this;
25452
25911
  }
25453
- /**
25454
- * Clear all interceptors from the stack
25455
- *
25456
- * @returns {void}
25457
- */
25458
- clear() {
25459
- if (this.handlers) {
25460
- this.handlers = [];
25912
+ };
25913
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
25914
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
25915
+ value
25916
+ }, key) => {
25917
+ let mapped = key[0].toUpperCase() + key.slice(1);
25918
+ return {
25919
+ get: () => value,
25920
+ set(headerValue) {
25921
+ this[mapped] = headerValue;
25922
+ }
25923
+ };
25924
+ });
25925
+ utils$1.freezeMethods(AxiosHeaders);
25926
+ var REDACTED = "[REDACTED ****]";
25927
+ function hasOwnOrPrototypeToJSON(source) {
25928
+ if (utils$1.hasOwnProp(source, "toJSON")) {
25929
+ return true;
25930
+ }
25931
+ let prototype2 = Object.getPrototypeOf(source);
25932
+ while (prototype2 && prototype2 !== Object.prototype) {
25933
+ if (utils$1.hasOwnProp(prototype2, "toJSON")) {
25934
+ return true;
25461
25935
  }
25936
+ prototype2 = Object.getPrototypeOf(prototype2);
25937
+ }
25938
+ return false;
25939
+ }
25940
+ function redactConfig(config, redactKeys) {
25941
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
25942
+ const seen = [];
25943
+ const visit = (source) => {
25944
+ if (source === null || typeof source !== "object") return source;
25945
+ if (utils$1.isBuffer(source)) return source;
25946
+ if (seen.indexOf(source) !== -1) return void 0;
25947
+ if (source instanceof AxiosHeaders) {
25948
+ source = source.toJSON();
25949
+ }
25950
+ seen.push(source);
25951
+ let result;
25952
+ if (utils$1.isArray(source)) {
25953
+ result = [];
25954
+ source.forEach((v, i) => {
25955
+ const reducedValue = visit(v);
25956
+ if (!utils$1.isUndefined(reducedValue)) {
25957
+ result[i] = reducedValue;
25958
+ }
25959
+ });
25960
+ } else {
25961
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
25962
+ seen.pop();
25963
+ return source;
25964
+ }
25965
+ result = /* @__PURE__ */ Object.create(null);
25966
+ for (const [key, value] of Object.entries(source)) {
25967
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
25968
+ if (!utils$1.isUndefined(reducedValue)) {
25969
+ result[key] = reducedValue;
25970
+ }
25971
+ }
25972
+ }
25973
+ seen.pop();
25974
+ return result;
25975
+ };
25976
+ return visit(config);
25977
+ }
25978
+ var AxiosError = class _AxiosError extends Error {
25979
+ static from(error, code, config, request, response, customProps) {
25980
+ const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
25981
+ axiosError.cause = error;
25982
+ axiosError.name = error.name;
25983
+ if (error.status != null && axiosError.status == null) {
25984
+ axiosError.status = error.status;
25985
+ }
25986
+ customProps && Object.assign(axiosError, customProps);
25987
+ return axiosError;
25462
25988
  }
25463
25989
  /**
25464
- * Iterate over all the registered interceptors
25465
- *
25466
- * This method is particularly useful for skipping over any
25467
- * interceptors that may have become `null` calling `eject`.
25990
+ * Create an Error with the specified message, config, error code, request and response.
25468
25991
  *
25469
- * @param {Function} fn The function to call for each interceptor
25992
+ * @param {string} message The error message.
25993
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
25994
+ * @param {Object} [config] The config.
25995
+ * @param {Object} [request] The request.
25996
+ * @param {Object} [response] The response.
25470
25997
  *
25471
- * @returns {void}
25998
+ * @returns {Error} The created error.
25472
25999
  */
25473
- forEach(fn) {
25474
- utils$1.forEach(this.handlers, function forEachHandler(h) {
25475
- if (h !== null) {
25476
- fn(h);
25477
- }
26000
+ constructor(message, code, config, request, response) {
26001
+ super(message);
26002
+ Object.defineProperty(this, "message", {
26003
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
26004
+ // this data descriptor into an accessor descriptor on the way in.
26005
+ __proto__: null,
26006
+ value: message,
26007
+ enumerable: true,
26008
+ writable: true,
26009
+ configurable: true
25478
26010
  });
26011
+ this.name = "AxiosError";
26012
+ this.isAxiosError = true;
26013
+ code && (this.code = code);
26014
+ config && (this.config = config);
26015
+ request && (this.request = request);
26016
+ if (response) {
26017
+ this.response = response;
26018
+ this.status = response.status;
26019
+ }
25479
26020
  }
25480
- };
25481
- var transitionalDefaults = {
25482
- silentJSONParsing: true,
25483
- forcedJSONParsing: true,
25484
- clarifyTimeoutError: false,
25485
- legacyInterceptorReqResOrdering: true
25486
- };
25487
- var URLSearchParams = url.URLSearchParams;
25488
- var ALPHA = "abcdefghijklmnopqrstuvwxyz";
25489
- var DIGIT = "0123456789";
25490
- var ALPHABET = {
25491
- DIGIT,
25492
- ALPHA,
25493
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
25494
- };
25495
- var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
25496
- let str = "";
25497
- const {
25498
- length
25499
- } = alphabet;
25500
- const randomValues = new Uint32Array(size);
25501
- crypto.randomFillSync(randomValues);
25502
- for (let i = 0; i < size; i++) {
25503
- str += alphabet[randomValues[i] % length];
26021
+ toJSON() {
26022
+ const config = this.config;
26023
+ const redactKeys = config && utils$1.hasOwnProp(config, "redact") ? config.redact : void 0;
26024
+ const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config);
26025
+ return {
26026
+ // Standard
26027
+ message: this.message,
26028
+ name: this.name,
26029
+ // Microsoft
26030
+ description: this.description,
26031
+ number: this.number,
26032
+ // Mozilla
26033
+ fileName: this.fileName,
26034
+ lineNumber: this.lineNumber,
26035
+ columnNumber: this.columnNumber,
26036
+ stack: this.stack,
26037
+ // Axios
26038
+ config: serializedConfig,
26039
+ code: this.code,
26040
+ status: this.status
26041
+ };
25504
26042
  }
25505
- return str;
25506
- };
25507
- var platform$1 = {
25508
- isNode: true,
25509
- classes: {
25510
- URLSearchParams,
25511
- FormData: FormData$1,
25512
- Blob: typeof Blob !== "undefined" && Blob || null
25513
- },
25514
- ALPHABET,
25515
- generateString,
25516
- protocols: ["http", "https", "file", "data"]
25517
26043
  };
25518
- var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
25519
- var _navigator = typeof navigator === "object" && navigator || void 0;
25520
- var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
25521
- var hasStandardBrowserWebWorkerEnv = (() => {
25522
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
25523
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
25524
- })();
25525
- var origin = hasBrowserEnv && window.location.href || "http://localhost";
25526
- var utils = /* @__PURE__ */ Object.freeze({
25527
- __proto__: null,
25528
- hasBrowserEnv,
25529
- hasStandardBrowserEnv,
25530
- hasStandardBrowserWebWorkerEnv,
25531
- navigator: _navigator,
25532
- origin
25533
- });
25534
- var platform = {
25535
- ...utils,
25536
- ...platform$1
25537
- };
25538
- function toURLEncodedForm(data, options) {
25539
- return toFormData(data, new platform.classes.URLSearchParams(), {
25540
- visitor: function(value, key, path2, helpers) {
25541
- if (platform.isNode && utils$1.isBuffer(value)) {
25542
- this.append(key, value.toString("base64"));
25543
- return false;
25544
- }
25545
- return helpers.defaultVisitor.apply(this, arguments);
25546
- },
25547
- ...options
25548
- });
26044
+ AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
26045
+ AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
26046
+ AxiosError.ECONNABORTED = "ECONNABORTED";
26047
+ AxiosError.ETIMEDOUT = "ETIMEDOUT";
26048
+ AxiosError.ECONNREFUSED = "ECONNREFUSED";
26049
+ AxiosError.ERR_NETWORK = "ERR_NETWORK";
26050
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
26051
+ AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
26052
+ AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
26053
+ AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
26054
+ AxiosError.ERR_CANCELED = "ERR_CANCELED";
26055
+ AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
26056
+ AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
26057
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
26058
+ function isVisitable(thing) {
26059
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
25549
26060
  }
25550
- function parsePropPath(name) {
25551
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => {
25552
- return match2[0] === "[]" ? "" : match2[1] || match2[0];
25553
- });
26061
+ function removeBrackets(key) {
26062
+ return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
25554
26063
  }
25555
- function arrayToObject(arr) {
25556
- const obj = {};
25557
- const keys = Object.keys(arr);
25558
- let i;
25559
- const len = keys.length;
25560
- let key;
25561
- for (i = 0; i < len; i++) {
25562
- key = keys[i];
25563
- obj[key] = arr[key];
25564
- }
25565
- return obj;
26064
+ function renderKey(path2, key, dots) {
26065
+ if (!path2) return key;
26066
+ return path2.concat(key).map(function each(token2, i) {
26067
+ token2 = removeBrackets(token2);
26068
+ return !dots && i ? "[" + token2 + "]" : token2;
26069
+ }).join(dots ? "." : "");
25566
26070
  }
25567
- function formDataToJSON(formData) {
25568
- function buildPath(path2, value, target, index) {
25569
- let name = path2[index++];
25570
- if (name === "__proto__") return true;
25571
- const isNumericKey = Number.isFinite(+name);
25572
- const isLast = index >= path2.length;
25573
- name = !name && utils$1.isArray(target) ? target.length : name;
25574
- if (isLast) {
25575
- if (utils$1.hasOwnProp(target, name)) {
25576
- target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
25577
- } else {
25578
- target[name] = value;
25579
- }
25580
- return !isNumericKey;
25581
- }
25582
- if (!target[name] || !utils$1.isObject(target[name])) {
25583
- target[name] = [];
25584
- }
25585
- const result = buildPath(path2, value, target[name], index);
25586
- if (result && utils$1.isArray(target[name])) {
25587
- target[name] = arrayToObject(target[name]);
25588
- }
25589
- return !isNumericKey;
25590
- }
25591
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
25592
- const obj = {};
25593
- utils$1.forEachEntry(formData, (name, value) => {
25594
- buildPath(parsePropPath(name), value, obj, 0);
25595
- });
25596
- return obj;
25597
- }
25598
- return null;
26071
+ function isFlatArray(arr) {
26072
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
25599
26073
  }
25600
- var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
25601
- function stringifySafely(rawValue, parser, encoder) {
25602
- if (utils$1.isString(rawValue)) {
25603
- try {
25604
- (parser || JSON.parse)(rawValue);
25605
- return utils$1.trim(rawValue);
25606
- } catch (e) {
25607
- if (e.name !== "SyntaxError") {
25608
- throw e;
25609
- }
25610
- }
26074
+ var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
26075
+ return /^is[A-Z]/.test(prop);
26076
+ });
26077
+ function toFormData(obj, formData, options) {
26078
+ if (!utils$1.isObject(obj)) {
26079
+ throw new TypeError("target must be an object");
25611
26080
  }
25612
- return (encoder || JSON.stringify)(rawValue);
25613
- }
25614
- var defaults = {
25615
- transitional: transitionalDefaults,
25616
- adapter: ["xhr", "http", "fetch"],
25617
- transformRequest: [function transformRequest(data, headers) {
25618
- const contentType = headers.getContentType() || "";
25619
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
25620
- const isObjectPayload = utils$1.isObject(data);
25621
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
25622
- data = new FormData(data);
25623
- }
25624
- const isFormData2 = utils$1.isFormData(data);
25625
- if (isFormData2) {
25626
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
25627
- }
25628
- if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
25629
- return data;
25630
- }
25631
- if (utils$1.isArrayBufferView(data)) {
25632
- return data.buffer;
25633
- }
25634
- if (utils$1.isURLSearchParams(data)) {
25635
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
25636
- return data.toString();
25637
- }
25638
- let isFileList2;
25639
- if (isObjectPayload) {
25640
- const formSerializer = own(this, "formSerializer");
25641
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
25642
- return toURLEncodedForm(data, formSerializer).toString();
25643
- }
25644
- if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
25645
- const env = own(this, "env");
25646
- const _FormData = env && env.FormData;
25647
- return toFormData(isFileList2 ? {
25648
- "files[]": data
25649
- } : data, _FormData && new _FormData(), formSerializer);
25650
- }
25651
- }
25652
- if (isObjectPayload || hasJSONContentType) {
25653
- headers.setContentType("application/json", false);
25654
- return stringifySafely(data);
25655
- }
25656
- return data;
25657
- }],
25658
- transformResponse: [function transformResponse(data) {
25659
- const transitional = own(this, "transitional") || defaults.transitional;
25660
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
25661
- const responseType = own(this, "responseType");
25662
- const JSONRequested = responseType === "json";
25663
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
25664
- return data;
26081
+ formData = formData || new (FormData$1 || FormData)();
26082
+ options = utils$1.toFlatObject(options, {
26083
+ metaTokens: true,
26084
+ dots: false,
26085
+ indexes: false
26086
+ }, false, function defined(option, source) {
26087
+ return !utils$1.isUndefined(source[option]);
26088
+ });
26089
+ const metaTokens = options.metaTokens;
26090
+ const visitor = options.visitor || defaultVisitor;
26091
+ const dots = options.dots;
26092
+ const indexes = options.indexes;
26093
+ const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
26094
+ const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
26095
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
26096
+ if (!utils$1.isFunction(visitor)) {
26097
+ throw new TypeError("visitor must be a function");
26098
+ }
26099
+ function convertValue(value) {
26100
+ if (value === null) return "";
26101
+ if (utils$1.isDate(value)) {
26102
+ return value.toISOString();
25665
26103
  }
25666
- if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
25667
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
25668
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
25669
- try {
25670
- return JSON.parse(data, own(this, "parseReviver"));
25671
- } catch (e) {
25672
- if (strictJSONParsing) {
25673
- if (e.name === "SyntaxError") {
25674
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response"));
25675
- }
25676
- throw e;
25677
- }
25678
- }
26104
+ if (utils$1.isBoolean(value)) {
26105
+ return value.toString();
25679
26106
  }
25680
- return data;
25681
- }],
25682
- /**
25683
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
25684
- * timeout is not created.
25685
- */
25686
- timeout: 0,
25687
- xsrfCookieName: "XSRF-TOKEN",
25688
- xsrfHeaderName: "X-XSRF-TOKEN",
25689
- maxContentLength: -1,
25690
- maxBodyLength: -1,
25691
- env: {
25692
- FormData: platform.classes.FormData,
25693
- Blob: platform.classes.Blob
25694
- },
25695
- validateStatus: function validateStatus(status) {
25696
- return status >= 200 && status < 300;
25697
- },
25698
- headers: {
25699
- common: {
25700
- Accept: "application/json, text/plain, */*",
25701
- "Content-Type": void 0
26107
+ if (!useBlob && utils$1.isBlob(value)) {
26108
+ throw new AxiosError("Blob is not supported. Use a Buffer instead.");
26109
+ }
26110
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
26111
+ return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
25702
26112
  }
26113
+ return value;
25703
26114
  }
25704
- };
25705
- utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
25706
- defaults.headers[method] = {};
25707
- });
25708
- var ignoreDuplicateOf = utils$1.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]);
25709
- var parseHeaders = (rawHeaders) => {
25710
- const parsed = {};
25711
- let key;
25712
- let val;
25713
- let i;
25714
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
25715
- i = line.indexOf(":");
25716
- key = line.substring(0, i).trim().toLowerCase();
25717
- val = line.substring(i + 1).trim();
25718
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
25719
- return;
26115
+ function defaultVisitor(value, key, path2) {
26116
+ let arr = value;
26117
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
26118
+ formData.append(renderKey(path2, key, dots), convertValue(value));
26119
+ return false;
25720
26120
  }
25721
- if (key === "set-cookie") {
25722
- if (parsed[key]) {
25723
- parsed[key].push(val);
25724
- } else {
25725
- parsed[key] = [val];
26121
+ if (value && !path2 && typeof value === "object") {
26122
+ if (utils$1.endsWith(key, "{}")) {
26123
+ key = metaTokens ? key : key.slice(0, -2);
26124
+ value = JSON.stringify(value);
26125
+ } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
26126
+ key = removeBrackets(key);
26127
+ arr.forEach(function each(el, index) {
26128
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
26129
+ // eslint-disable-next-line no-nested-ternary
26130
+ indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
26131
+ convertValue(el)
26132
+ );
26133
+ });
26134
+ return false;
25726
26135
  }
25727
- } else {
25728
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
25729
26136
  }
25730
- });
25731
- return parsed;
25732
- };
25733
- var $internals = /* @__PURE__ */ Symbol("internals");
25734
- var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
25735
- function trimSPorHTAB(str) {
25736
- let start = 0;
25737
- let end = str.length;
25738
- while (start < end) {
25739
- const code = str.charCodeAt(start);
25740
- if (code !== 9 && code !== 32) {
25741
- break;
26137
+ if (isVisitable(value)) {
26138
+ return true;
25742
26139
  }
25743
- start += 1;
26140
+ formData.append(renderKey(path2, key, dots), convertValue(value));
26141
+ return false;
25744
26142
  }
25745
- while (end > start) {
25746
- const code = str.charCodeAt(end - 1);
25747
- if (code !== 9 && code !== 32) {
25748
- break;
26143
+ const stack = [];
26144
+ const exposedHelpers = Object.assign(predicates, {
26145
+ defaultVisitor,
26146
+ convertValue,
26147
+ isVisitable
26148
+ });
26149
+ function build(value, path2, depth = 0) {
26150
+ if (utils$1.isUndefined(value)) return;
26151
+ if (depth > maxDepth) {
26152
+ throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
25749
26153
  }
25750
- end -= 1;
26154
+ if (stack.indexOf(value) !== -1) {
26155
+ throw Error("Circular reference detected in " + path2.join("."));
26156
+ }
26157
+ stack.push(value);
26158
+ utils$1.forEach(value, function each(el, key) {
26159
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path2, exposedHelpers);
26160
+ if (result === true) {
26161
+ build(el, path2 ? path2.concat(key) : [key], depth + 1);
26162
+ }
26163
+ });
26164
+ stack.pop();
25751
26165
  }
25752
- return start === 0 && end === str.length ? str : str.slice(start, end);
26166
+ if (!utils$1.isObject(obj)) {
26167
+ throw new TypeError("data must be an object");
26168
+ }
26169
+ build(obj);
26170
+ return formData;
25753
26171
  }
25754
- function normalizeHeader(header) {
25755
- return header && String(header).trim().toLowerCase();
26172
+ function encode$1(str) {
26173
+ const charMap = {
26174
+ "!": "%21",
26175
+ "'": "%27",
26176
+ "(": "%28",
26177
+ ")": "%29",
26178
+ "~": "%7E",
26179
+ "%20": "+"
26180
+ };
26181
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match2) {
26182
+ return charMap[match2];
26183
+ });
25756
26184
  }
25757
- function sanitizeHeaderValue(str) {
25758
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
26185
+ function AxiosURLSearchParams(params, options) {
26186
+ this._pairs = [];
26187
+ params && toFormData(params, this, options);
25759
26188
  }
25760
- function normalizeValue(value) {
25761
- if (value === false || value == null) {
25762
- return value;
25763
- }
25764
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
26189
+ var prototype = AxiosURLSearchParams.prototype;
26190
+ prototype.append = function append(name, value) {
26191
+ this._pairs.push([name, value]);
26192
+ };
26193
+ prototype.toString = function toString3(encoder) {
26194
+ const _encode = encoder ? function(value) {
26195
+ return encoder.call(this, value, encode$1);
26196
+ } : encode$1;
26197
+ return this._pairs.map(function each(pair) {
26198
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
26199
+ }, "").join("&");
26200
+ };
26201
+ function encode(val) {
26202
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
25765
26203
  }
25766
- function parseTokens(str) {
25767
- const tokens = /* @__PURE__ */ Object.create(null);
25768
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
25769
- let match2;
25770
- while (match2 = tokensRE.exec(str)) {
25771
- tokens[match2[1]] = match2[2];
26204
+ function buildURL(url2, params, options) {
26205
+ if (!params) {
26206
+ return url2;
25772
26207
  }
25773
- return tokens;
26208
+ const _encode = options && options.encode || encode;
26209
+ const _options = utils$1.isFunction(options) ? {
26210
+ serialize: options
26211
+ } : options;
26212
+ const serializeFn = _options && _options.serialize;
26213
+ let serializedParams;
26214
+ if (serializeFn) {
26215
+ serializedParams = serializeFn(params, _options);
26216
+ } else {
26217
+ serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
26218
+ }
26219
+ if (serializedParams) {
26220
+ const hashmarkIndex = url2.indexOf("#");
26221
+ if (hashmarkIndex !== -1) {
26222
+ url2 = url2.slice(0, hashmarkIndex);
26223
+ }
26224
+ url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
26225
+ }
26226
+ return url2;
25774
26227
  }
25775
- var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
25776
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
25777
- if (utils$1.isFunction(filter)) {
25778
- return filter.call(this, value, header);
26228
+ var InterceptorManager = class {
26229
+ constructor() {
26230
+ this.handlers = [];
25779
26231
  }
25780
- if (isHeaderNameFilter) {
25781
- value = header;
26232
+ /**
26233
+ * Add a new interceptor to the stack
26234
+ *
26235
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
26236
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
26237
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
26238
+ *
26239
+ * @return {Number} An ID used to remove interceptor later
26240
+ */
26241
+ use(fulfilled, rejected, options) {
26242
+ this.handlers.push({
26243
+ fulfilled,
26244
+ rejected,
26245
+ synchronous: options ? options.synchronous : false,
26246
+ runWhen: options ? options.runWhen : null
26247
+ });
26248
+ return this.handlers.length - 1;
25782
26249
  }
25783
- if (!utils$1.isString(value)) return;
25784
- if (utils$1.isString(filter)) {
25785
- return value.indexOf(filter) !== -1;
26250
+ /**
26251
+ * Remove an interceptor from the stack
26252
+ *
26253
+ * @param {Number} id The ID that was returned by `use`
26254
+ *
26255
+ * @returns {void}
26256
+ */
26257
+ eject(id) {
26258
+ if (this.handlers[id]) {
26259
+ this.handlers[id] = null;
26260
+ }
26261
+ }
26262
+ /**
26263
+ * Clear all interceptors from the stack
26264
+ *
26265
+ * @returns {void}
26266
+ */
26267
+ clear() {
26268
+ if (this.handlers) {
26269
+ this.handlers = [];
26270
+ }
26271
+ }
26272
+ /**
26273
+ * Iterate over all the registered interceptors
26274
+ *
26275
+ * This method is particularly useful for skipping over any
26276
+ * interceptors that may have become `null` calling `eject`.
26277
+ *
26278
+ * @param {Function} fn The function to call for each interceptor
26279
+ *
26280
+ * @returns {void}
26281
+ */
26282
+ forEach(fn) {
26283
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
26284
+ if (h !== null) {
26285
+ fn(h);
26286
+ }
26287
+ });
25786
26288
  }
25787
- if (utils$1.isRegExp(filter)) {
25788
- return filter.test(value);
26289
+ };
26290
+ var transitionalDefaults = {
26291
+ silentJSONParsing: true,
26292
+ forcedJSONParsing: true,
26293
+ clarifyTimeoutError: false,
26294
+ legacyInterceptorReqResOrdering: true
26295
+ };
26296
+ var URLSearchParams = url.URLSearchParams;
26297
+ var ALPHA = "abcdefghijklmnopqrstuvwxyz";
26298
+ var DIGIT = "0123456789";
26299
+ var ALPHABET = {
26300
+ DIGIT,
26301
+ ALPHA,
26302
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
26303
+ };
26304
+ var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
26305
+ let str = "";
26306
+ const {
26307
+ length
26308
+ } = alphabet;
26309
+ const randomValues = new Uint32Array(size);
26310
+ crypto.randomFillSync(randomValues);
26311
+ for (let i = 0; i < size; i++) {
26312
+ str += alphabet[randomValues[i] % length];
25789
26313
  }
25790
- }
25791
- function formatHeader(header) {
25792
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
25793
- return char.toUpperCase() + str;
26314
+ return str;
26315
+ };
26316
+ var platform$1 = {
26317
+ isNode: true,
26318
+ classes: {
26319
+ URLSearchParams,
26320
+ FormData: FormData$1,
26321
+ Blob: typeof Blob !== "undefined" && Blob || null
26322
+ },
26323
+ ALPHABET,
26324
+ generateString,
26325
+ protocols: ["http", "https", "file", "data"]
26326
+ };
26327
+ var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
26328
+ var _navigator = typeof navigator === "object" && navigator || void 0;
26329
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
26330
+ var hasStandardBrowserWebWorkerEnv = (() => {
26331
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
26332
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
26333
+ })();
26334
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
26335
+ var utils = /* @__PURE__ */ Object.freeze({
26336
+ __proto__: null,
26337
+ hasBrowserEnv,
26338
+ hasStandardBrowserEnv,
26339
+ hasStandardBrowserWebWorkerEnv,
26340
+ navigator: _navigator,
26341
+ origin
26342
+ });
26343
+ var platform = {
26344
+ ...utils,
26345
+ ...platform$1
26346
+ };
26347
+ function toURLEncodedForm(data, options) {
26348
+ return toFormData(data, new platform.classes.URLSearchParams(), {
26349
+ visitor: function(value, key, path2, helpers) {
26350
+ if (platform.isNode && utils$1.isBuffer(value)) {
26351
+ this.append(key, value.toString("base64"));
26352
+ return false;
26353
+ }
26354
+ return helpers.defaultVisitor.apply(this, arguments);
26355
+ },
26356
+ ...options
25794
26357
  });
25795
26358
  }
25796
- function buildAccessors(obj, header) {
25797
- const accessorName = utils$1.toCamelCase(" " + header);
25798
- ["get", "set", "has"].forEach((methodName) => {
25799
- Object.defineProperty(obj, methodName + accessorName, {
25800
- value: function(arg1, arg2, arg3) {
25801
- return this[methodName].call(this, header, arg1, arg2, arg3);
25802
- },
25803
- configurable: true
25804
- });
26359
+ function parsePropPath(name) {
26360
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => {
26361
+ return match2[0] === "[]" ? "" : match2[1] || match2[0];
25805
26362
  });
25806
26363
  }
25807
- var AxiosHeaders = class {
25808
- constructor(headers) {
25809
- headers && this.set(headers);
26364
+ function arrayToObject(arr) {
26365
+ const obj = {};
26366
+ const keys = Object.keys(arr);
26367
+ let i;
26368
+ const len = keys.length;
26369
+ let key;
26370
+ for (i = 0; i < len; i++) {
26371
+ key = keys[i];
26372
+ obj[key] = arr[key];
25810
26373
  }
25811
- set(header, valueOrRewrite, rewrite) {
25812
- const self2 = this;
25813
- function setHeader(_value, _header, _rewrite) {
25814
- const lHeader = normalizeHeader(_header);
25815
- if (!lHeader) {
25816
- throw new Error("header name must be a non-empty string");
25817
- }
25818
- const key = utils$1.findKey(self2, lHeader);
25819
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
25820
- self2[key || _header] = normalizeValue(_value);
26374
+ return obj;
26375
+ }
26376
+ function formDataToJSON(formData) {
26377
+ function buildPath(path2, value, target, index) {
26378
+ let name = path2[index++];
26379
+ if (name === "__proto__") return true;
26380
+ const isNumericKey = Number.isFinite(+name);
26381
+ const isLast = index >= path2.length;
26382
+ name = !name && utils$1.isArray(target) ? target.length : name;
26383
+ if (isLast) {
26384
+ if (utils$1.hasOwnProp(target, name)) {
26385
+ target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
26386
+ } else {
26387
+ target[name] = value;
25821
26388
  }
26389
+ return !isNumericKey;
25822
26390
  }
25823
- const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
25824
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
25825
- setHeaders(header, valueOrRewrite);
25826
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
25827
- setHeaders(parseHeaders(header), valueOrRewrite);
25828
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
25829
- let obj = {}, dest, key;
25830
- for (const entry of header) {
25831
- if (!utils$1.isArray(entry)) {
25832
- throw TypeError("Object iterator must return a key-value pair");
25833
- }
25834
- obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
25835
- }
25836
- setHeaders(obj, valueOrRewrite);
25837
- } else {
25838
- header != null && setHeader(valueOrRewrite, header, rewrite);
26391
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
26392
+ target[name] = [];
25839
26393
  }
25840
- return this;
26394
+ const result = buildPath(path2, value, target[name], index);
26395
+ if (result && utils$1.isArray(target[name])) {
26396
+ target[name] = arrayToObject(target[name]);
26397
+ }
26398
+ return !isNumericKey;
25841
26399
  }
25842
- get(header, parser) {
25843
- header = normalizeHeader(header);
25844
- if (header) {
25845
- const key = utils$1.findKey(this, header);
25846
- if (key) {
25847
- const value = this[key];
25848
- if (!parser) {
25849
- return value;
25850
- }
25851
- if (parser === true) {
25852
- return parseTokens(value);
25853
- }
25854
- if (utils$1.isFunction(parser)) {
25855
- return parser.call(this, value, key);
25856
- }
25857
- if (utils$1.isRegExp(parser)) {
25858
- return parser.exec(value);
25859
- }
25860
- throw new TypeError("parser must be boolean|regexp|function");
26400
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
26401
+ const obj = {};
26402
+ utils$1.forEachEntry(formData, (name, value) => {
26403
+ buildPath(parsePropPath(name), value, obj, 0);
26404
+ });
26405
+ return obj;
26406
+ }
26407
+ return null;
26408
+ }
26409
+ var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
26410
+ function stringifySafely(rawValue, parser, encoder) {
26411
+ if (utils$1.isString(rawValue)) {
26412
+ try {
26413
+ (parser || JSON.parse)(rawValue);
26414
+ return utils$1.trim(rawValue);
26415
+ } catch (e) {
26416
+ if (e.name !== "SyntaxError") {
26417
+ throw e;
25861
26418
  }
25862
26419
  }
25863
26420
  }
25864
- has(header, matcher) {
25865
- header = normalizeHeader(header);
25866
- if (header) {
25867
- const key = utils$1.findKey(this, header);
25868
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
26421
+ return (encoder || JSON.stringify)(rawValue);
26422
+ }
26423
+ var defaults = {
26424
+ transitional: transitionalDefaults,
26425
+ adapter: ["xhr", "http", "fetch"],
26426
+ transformRequest: [function transformRequest(data, headers) {
26427
+ const contentType = headers.getContentType() || "";
26428
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
26429
+ const isObjectPayload = utils$1.isObject(data);
26430
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
26431
+ data = new FormData(data);
25869
26432
  }
25870
- return false;
25871
- }
25872
- delete(header, matcher) {
25873
- const self2 = this;
25874
- let deleted = false;
25875
- function deleteHeader(_header) {
25876
- _header = normalizeHeader(_header);
25877
- if (_header) {
25878
- const key = utils$1.findKey(self2, _header);
25879
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
25880
- delete self2[key];
25881
- deleted = true;
25882
- }
25883
- }
26433
+ const isFormData2 = utils$1.isFormData(data);
26434
+ if (isFormData2) {
26435
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
25884
26436
  }
25885
- if (utils$1.isArray(header)) {
25886
- header.forEach(deleteHeader);
25887
- } else {
25888
- deleteHeader(header);
26437
+ if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
26438
+ return data;
25889
26439
  }
25890
- return deleted;
25891
- }
25892
- clear(matcher) {
25893
- const keys = Object.keys(this);
25894
- let i = keys.length;
25895
- let deleted = false;
25896
- while (i--) {
25897
- const key = keys[i];
25898
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
25899
- delete this[key];
25900
- deleted = true;
25901
- }
26440
+ if (utils$1.isArrayBufferView(data)) {
26441
+ return data.buffer;
25902
26442
  }
25903
- return deleted;
25904
- }
25905
- normalize(format2) {
25906
- const self2 = this;
25907
- const headers = {};
25908
- utils$1.forEach(this, (value, header) => {
25909
- const key = utils$1.findKey(headers, header);
25910
- if (key) {
25911
- self2[key] = normalizeValue(value);
25912
- delete self2[header];
25913
- return;
26443
+ if (utils$1.isURLSearchParams(data)) {
26444
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
26445
+ return data.toString();
26446
+ }
26447
+ let isFileList2;
26448
+ if (isObjectPayload) {
26449
+ const formSerializer = own(this, "formSerializer");
26450
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
26451
+ return toURLEncodedForm(data, formSerializer).toString();
25914
26452
  }
25915
- const normalized = format2 ? formatHeader(header) : String(header).trim();
25916
- if (normalized !== header) {
25917
- delete self2[header];
26453
+ if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
26454
+ const env = own(this, "env");
26455
+ const _FormData = env && env.FormData;
26456
+ return toFormData(isFileList2 ? {
26457
+ "files[]": data
26458
+ } : data, _FormData && new _FormData(), formSerializer);
25918
26459
  }
25919
- self2[normalized] = normalizeValue(value);
25920
- headers[normalized] = true;
25921
- });
25922
- return this;
25923
- }
25924
- concat(...targets) {
25925
- return this.constructor.concat(this, ...targets);
25926
- }
25927
- toJSON(asStrings) {
25928
- const obj = /* @__PURE__ */ Object.create(null);
25929
- utils$1.forEach(this, (value, header) => {
25930
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
25931
- });
25932
- return obj;
25933
- }
25934
- [Symbol.iterator]() {
25935
- return Object.entries(this.toJSON())[Symbol.iterator]();
25936
- }
25937
- toString() {
25938
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
25939
- }
25940
- getSetCookie() {
25941
- return this.get("set-cookie") || [];
25942
- }
25943
- get [Symbol.toStringTag]() {
25944
- return "AxiosHeaders";
25945
- }
25946
- static from(thing) {
25947
- return thing instanceof this ? thing : new this(thing);
25948
- }
25949
- static concat(first2, ...targets) {
25950
- const computed = new this(first2);
25951
- targets.forEach((target) => computed.set(target));
25952
- return computed;
25953
- }
25954
- static accessor(header) {
25955
- const internals = this[$internals] = this[$internals] = {
25956
- accessors: {}
25957
- };
25958
- const accessors = internals.accessors;
25959
- const prototype2 = this.prototype;
25960
- function defineAccessor(_header) {
25961
- const lHeader = normalizeHeader(_header);
25962
- if (!accessors[lHeader]) {
25963
- buildAccessors(prototype2, _header);
25964
- accessors[lHeader] = true;
26460
+ }
26461
+ if (isObjectPayload || hasJSONContentType) {
26462
+ headers.setContentType("application/json", false);
26463
+ return stringifySafely(data);
26464
+ }
26465
+ return data;
26466
+ }],
26467
+ transformResponse: [function transformResponse(data) {
26468
+ const transitional = own(this, "transitional") || defaults.transitional;
26469
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
26470
+ const responseType = own(this, "responseType");
26471
+ const JSONRequested = responseType === "json";
26472
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
26473
+ return data;
26474
+ }
26475
+ if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
26476
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
26477
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
26478
+ try {
26479
+ return JSON.parse(data, own(this, "parseReviver"));
26480
+ } catch (e) {
26481
+ if (strictJSONParsing) {
26482
+ if (e.name === "SyntaxError") {
26483
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response"));
26484
+ }
26485
+ throw e;
26486
+ }
25965
26487
  }
25966
26488
  }
25967
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
25968
- return this;
26489
+ return data;
26490
+ }],
26491
+ /**
26492
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
26493
+ * timeout is not created.
26494
+ */
26495
+ timeout: 0,
26496
+ xsrfCookieName: "XSRF-TOKEN",
26497
+ xsrfHeaderName: "X-XSRF-TOKEN",
26498
+ maxContentLength: -1,
26499
+ maxBodyLength: -1,
26500
+ env: {
26501
+ FormData: platform.classes.FormData,
26502
+ Blob: platform.classes.Blob
26503
+ },
26504
+ validateStatus: function validateStatus(status) {
26505
+ return status >= 200 && status < 300;
26506
+ },
26507
+ headers: {
26508
+ common: {
26509
+ Accept: "application/json, text/plain, */*",
26510
+ "Content-Type": void 0
26511
+ }
25969
26512
  }
25970
26513
  };
25971
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
25972
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
25973
- value
25974
- }, key) => {
25975
- let mapped = key[0].toUpperCase() + key.slice(1);
25976
- return {
25977
- get: () => value,
25978
- set(headerValue) {
25979
- this[mapped] = headerValue;
25980
- }
25981
- };
26514
+ utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => {
26515
+ defaults.headers[method] = {};
25982
26516
  });
25983
- utils$1.freezeMethods(AxiosHeaders);
25984
26517
  function transformData(fns, response) {
25985
26518
  const config = this || defaults;
25986
26519
  const context = response || config;
@@ -26016,7 +26549,7 @@ var require_axios = __commonJS({
26016
26549
  if (!response.status || !validateStatus || validateStatus(response.status)) {
26017
26550
  resolve(response);
26018
26551
  } else {
26019
- reject(new AxiosError("Request failed with status code " + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
26552
+ reject(new AxiosError("Request failed with status code " + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response));
26020
26553
  }
26021
26554
  }
26022
26555
  function isAbsoluteURL(url2) {
@@ -26100,12 +26633,12 @@ var require_axios = __commonJS({
26100
26633
  function getEnv(key) {
26101
26634
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
26102
26635
  }
26103
- var VERSION2 = "1.15.2";
26636
+ var VERSION2 = "1.16.1";
26104
26637
  function parseProtocol(url2) {
26105
- const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
26638
+ const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
26106
26639
  return match2 && match2[1] || "";
26107
26640
  }
26108
- var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
26641
+ var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
26109
26642
  function fromDataURI(uri, asBlob, options) {
26110
26643
  const _Blob = options && options.Blob || platform.classes.Blob;
26111
26644
  const protocol = parseProtocol(uri);
@@ -26118,10 +26651,17 @@ var require_axios = __commonJS({
26118
26651
  if (!match2) {
26119
26652
  throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL);
26120
26653
  }
26121
- const mime = match2[1];
26122
- const isBase64 = match2[2];
26123
- const body = match2[3];
26124
- const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
26654
+ const type = match2[1];
26655
+ const params = match2[2];
26656
+ const encoding = match2[3] ? "base64" : "utf8";
26657
+ const body = match2[4];
26658
+ let mime;
26659
+ if (type) {
26660
+ mime = params ? type + params : type;
26661
+ } else if (params) {
26662
+ mime = "text/plain" + params;
26663
+ }
26664
+ const buffer = Buffer.from(decodeURIComponent(body), encoding);
26125
26665
  if (asBlob) {
26126
26666
  if (!_Blob) {
26127
26667
  throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT);
@@ -26313,7 +26853,7 @@ var require_axios = __commonJS({
26313
26853
  throw TypeError("FormData instance required");
26314
26854
  }
26315
26855
  if (boundary.length < 1 || boundary.length > 70) {
26316
- throw Error("boundary must be 10-70 characters long");
26856
+ throw Error("boundary must be 1-70 characters long");
26317
26857
  }
26318
26858
  const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
26319
26859
  const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
@@ -26430,6 +26970,20 @@ var require_axios = __commonJS({
26430
26970
  }
26431
26971
  return [entryHost, entryPort];
26432
26972
  };
26973
+ var IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i;
26974
+ var IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i;
26975
+ var unmapIPv4MappedIPv6 = (host) => {
26976
+ if (typeof host !== "string" || host.indexOf(":") === -1) return host;
26977
+ const dotted = host.match(IPV4_MAPPED_DOTTED_RE);
26978
+ if (dotted) return dotted[1];
26979
+ const hex = host.match(IPV4_MAPPED_HEX_RE);
26980
+ if (hex) {
26981
+ const high = parseInt(hex[1], 16);
26982
+ const low = parseInt(hex[2], 16);
26983
+ return `${high >> 8}.${high & 255}.${low >> 8}.${low & 255}`;
26984
+ }
26985
+ return host;
26986
+ };
26433
26987
  var normalizeNoProxyHost = (hostname) => {
26434
26988
  if (!hostname) {
26435
26989
  return hostname;
@@ -26437,7 +26991,7 @@ var require_axios = __commonJS({
26437
26991
  if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
26438
26992
  hostname = hostname.slice(1, -1);
26439
26993
  }
26440
- return hostname.replace(/\.+$/, "");
26994
+ return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ""));
26441
26995
  };
26442
26996
  function shouldBypassProxy(location) {
26443
26997
  let parsed;
@@ -26545,6 +27099,9 @@ var require_axios = __commonJS({
26545
27099
  let bytesNotified = 0;
26546
27100
  const _speedometer = speedometer(50, 250);
26547
27101
  return throttle((e) => {
27102
+ if (!e || typeof e.loaded !== "number") {
27103
+ return;
27104
+ }
26548
27105
  const rawLoaded = e.loaded;
26549
27106
  const total = e.lengthComputable ? e.total : void 0;
26550
27107
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -26618,10 +27175,32 @@ var require_axios = __commonJS({
26618
27175
  }
26619
27176
  }
26620
27177
  const groups = Math.floor(effectiveLen / 4);
26621
- const bytes = groups * 3 - (pad3 || 0);
26622
- return bytes > 0 ? bytes : 0;
27178
+ const bytes2 = groups * 3 - (pad3 || 0);
27179
+ return bytes2 > 0 ? bytes2 : 0;
27180
+ }
27181
+ if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") {
27182
+ return Buffer.byteLength(body, "utf8");
27183
+ }
27184
+ let bytes = 0;
27185
+ for (let i = 0, len = body.length; i < len; i++) {
27186
+ const c = body.charCodeAt(i);
27187
+ if (c < 128) {
27188
+ bytes += 1;
27189
+ } else if (c < 2048) {
27190
+ bytes += 2;
27191
+ } else if (c >= 55296 && c <= 56319 && i + 1 < len) {
27192
+ const next = body.charCodeAt(i + 1);
27193
+ if (next >= 56320 && next <= 57343) {
27194
+ bytes += 4;
27195
+ i++;
27196
+ } else {
27197
+ bytes += 3;
27198
+ }
27199
+ } else {
27200
+ bytes += 3;
27201
+ }
26623
27202
  }
26624
- return Buffer.byteLength(body, "utf8");
27203
+ return bytes;
26625
27204
  }
26626
27205
  var zlibOptions = {
26627
27206
  flush: zlib.constants.Z_SYNC_FLUSH,
@@ -26637,11 +27216,50 @@ var require_axios = __commonJS({
26637
27216
  https: httpsFollow
26638
27217
  } = followRedirects;
26639
27218
  var isHttps = /https:?/;
27219
+ var FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"];
27220
+ function setFormDataHeaders$1(headers, formHeaders, policy) {
27221
+ if (policy !== "content-only") {
27222
+ headers.set(formHeaders);
27223
+ return;
27224
+ }
27225
+ Object.entries(formHeaders).forEach(([key, val]) => {
27226
+ if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
27227
+ headers.set(key, val);
27228
+ }
27229
+ });
27230
+ }
26640
27231
  var kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener");
26641
27232
  var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq");
27233
+ var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
27234
+ var tunnelingAgentCache = /* @__PURE__ */ new Map();
27235
+ var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
27236
+ function getTunnelingAgent(agentOptions, userHttpsAgent) {
27237
+ const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
27238
+ const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache;
27239
+ let agent = cache.get(key);
27240
+ if (agent) return agent;
27241
+ const merged = userHttpsAgent && userHttpsAgent.options ? {
27242
+ ...userHttpsAgent.options,
27243
+ ...agentOptions
27244
+ } : agentOptions;
27245
+ agent = new HttpsProxyAgent(merged);
27246
+ agent[kAxiosInstalledTunnel] = true;
27247
+ cache.set(key, agent);
27248
+ return agent;
27249
+ }
26642
27250
  var supportedProtocols = platform.protocols.map((protocol) => {
26643
27251
  return protocol + ":";
26644
27252
  });
27253
+ var decodeURIComponentSafe = (value) => {
27254
+ if (!utils$1.isString(value)) {
27255
+ return value;
27256
+ }
27257
+ try {
27258
+ return decodeURIComponent(value);
27259
+ } catch (error) {
27260
+ return value;
27261
+ }
27262
+ };
26645
27263
  var flushOnFinish = (stream2, [throttled, flush]) => {
26646
27264
  stream2.on("end", flush).on("error", flush);
26647
27265
  return throttled;
@@ -26718,15 +27336,15 @@ var require_axios = __commonJS({
26718
27336
  }
26719
27337
  };
26720
27338
  var http2Sessions = new Http2Sessions();
26721
- function dispatchBeforeRedirect(options, responseDetails) {
27339
+ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
26722
27340
  if (options.beforeRedirects.proxy) {
26723
27341
  options.beforeRedirects.proxy(options);
26724
27342
  }
26725
27343
  if (options.beforeRedirects.config) {
26726
- options.beforeRedirects.config(options, responseDetails);
27344
+ options.beforeRedirects.config(options, responseDetails, requestDetails);
26727
27345
  }
26728
27346
  }
26729
- function setProxy(options, configProxy, location) {
27347
+ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {
26730
27348
  let proxy = configProxy;
26731
27349
  if (!proxy && proxy !== false) {
26732
27350
  const proxyUrl = getProxyForUrl(location);
@@ -26736,34 +27354,90 @@ var require_axios = __commonJS({
26736
27354
  }
26737
27355
  }
26738
27356
  }
26739
- if (proxy) {
26740
- if (proxy.username) {
26741
- proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
27357
+ if (isRedirect && options.headers) {
27358
+ for (const name of Object.keys(options.headers)) {
27359
+ if (name.toLowerCase() === "proxy-authorization") {
27360
+ delete options.headers[name];
27361
+ }
26742
27362
  }
26743
- if (proxy.auth) {
26744
- const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
27363
+ }
27364
+ if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
27365
+ options.agent = void 0;
27366
+ }
27367
+ if (proxy) {
27368
+ const isProxyURL = proxy instanceof URL;
27369
+ const readProxyField = (key) => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : void 0;
27370
+ const proxyUsername = readProxyField("username");
27371
+ const proxyPassword = readProxyField("password");
27372
+ let proxyAuth = utils$1.hasOwnProp(proxy, "auth") ? proxy.auth : void 0;
27373
+ if (proxyUsername) {
27374
+ proxyAuth = (proxyUsername || "") + ":" + (proxyPassword || "");
27375
+ }
27376
+ if (proxyAuth) {
27377
+ const authIsObject = typeof proxyAuth === "object";
27378
+ const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, "username") ? proxyAuth.username : void 0;
27379
+ const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, "password") ? proxyAuth.password : void 0;
27380
+ const validProxyAuth = Boolean(authUsername || authPassword);
26745
27381
  if (validProxyAuth) {
26746
- proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
26747
- } else if (typeof proxy.auth === "object") {
27382
+ proxyAuth = (authUsername || "") + ":" + (authPassword || "");
27383
+ } else if (authIsObject) {
26748
27384
  throw new AxiosError("Invalid proxy authorization", AxiosError.ERR_BAD_OPTION, {
26749
27385
  proxy
26750
27386
  });
26751
27387
  }
26752
- const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
26753
- options.headers["Proxy-Authorization"] = "Basic " + base64;
26754
27388
  }
26755
- options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
26756
- const proxyHost = proxy.hostname || proxy.host;
26757
- options.hostname = proxyHost;
26758
- options.host = proxyHost;
26759
- options.port = proxy.port;
26760
- options.path = location;
26761
- if (proxy.protocol) {
26762
- options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
27389
+ const targetIsHttps = isHttps.test(options.protocol);
27390
+ if (targetIsHttps) {
27391
+ if (!(configHttpsAgent instanceof HttpsProxyAgent)) {
27392
+ const proxyHost = readProxyField("hostname") || readProxyField("host");
27393
+ const proxyPort = readProxyField("port");
27394
+ const rawProxyProtocol = readProxyField("protocol");
27395
+ const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(":") ? rawProxyProtocol : `${rawProxyProtocol}:` : "http:";
27396
+ const proxyHostForURL = proxyHost && proxyHost.includes(":") && !proxyHost.startsWith("[") ? `[${proxyHost}]` : proxyHost;
27397
+ const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ":" + proxyPort : ""}`);
27398
+ const agentOptions = {
27399
+ protocol: proxyURL.protocol,
27400
+ hostname: proxyURL.hostname.replace(/^\[|\]$/g, ""),
27401
+ port: proxyURL.port,
27402
+ auth: proxyAuth && typeof proxyAuth === "string" ? proxyAuth : void 0
27403
+ };
27404
+ if (proxyURL.protocol === "https:") {
27405
+ agentOptions.ALPNProtocols = ["http/1.1"];
27406
+ }
27407
+ const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent);
27408
+ options.agent = tunnelingAgent;
27409
+ if (options.agents) {
27410
+ options.agents.https = tunnelingAgent;
27411
+ }
27412
+ }
27413
+ } else {
27414
+ if (proxyAuth) {
27415
+ const base64 = Buffer.from(proxyAuth, "utf8").toString("base64");
27416
+ options.headers["Proxy-Authorization"] = "Basic " + base64;
27417
+ }
27418
+ let hasUserHostHeader = false;
27419
+ for (const name of Object.keys(options.headers)) {
27420
+ if (name.toLowerCase() === "host") {
27421
+ hasUserHostHeader = true;
27422
+ break;
27423
+ }
27424
+ }
27425
+ if (!hasUserHostHeader) {
27426
+ options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
27427
+ }
27428
+ const proxyHost = readProxyField("hostname") || readProxyField("host");
27429
+ options.hostname = proxyHost;
27430
+ options.host = proxyHost;
27431
+ options.port = readProxyField("port");
27432
+ options.path = location;
27433
+ const proxyProtocol = readProxyField("protocol");
27434
+ if (proxyProtocol) {
27435
+ options.protocol = proxyProtocol.includes(":") ? proxyProtocol : `${proxyProtocol}:`;
27436
+ }
26763
27437
  }
26764
27438
  }
26765
27439
  options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
26766
- setProxy(redirectOptions, configProxy, redirectOptions.href);
27440
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);
26767
27441
  };
26768
27442
  }
26769
27443
  var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
@@ -26853,6 +27527,7 @@ var require_axios = __commonJS({
26853
27527
  let isDone;
26854
27528
  let rejected = false;
26855
27529
  let req;
27530
+ let connectPhaseTimer;
26856
27531
  httpVersion = +httpVersion;
26857
27532
  if (Number.isNaN(httpVersion)) {
26858
27533
  throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
@@ -26881,8 +27556,23 @@ var require_axios = __commonJS({
26881
27556
  console.warn("emit error", err);
26882
27557
  }
26883
27558
  }
27559
+ function clearConnectPhaseTimer() {
27560
+ if (connectPhaseTimer) {
27561
+ clearTimeout(connectPhaseTimer);
27562
+ connectPhaseTimer = null;
27563
+ }
27564
+ }
27565
+ function createTimeoutError() {
27566
+ let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
27567
+ const transitional = config.transitional || transitionalDefaults;
27568
+ if (config.timeoutErrorMessage) {
27569
+ timeoutErrorMessage = config.timeoutErrorMessage;
27570
+ }
27571
+ return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
27572
+ }
26884
27573
  abortEmitter.once("abort", reject);
26885
27574
  const onFinished = () => {
27575
+ clearConnectPhaseTimer();
26886
27576
  if (config.cancelToken) {
26887
27577
  config.cancelToken.unsubscribe(abort);
26888
27578
  }
@@ -26899,6 +27589,7 @@ var require_axios = __commonJS({
26899
27589
  }
26900
27590
  onDone((response, isRejected) => {
26901
27591
  isDone = true;
27592
+ clearConnectPhaseTimer();
26902
27593
  if (isRejected) {
26903
27594
  rejected = true;
26904
27595
  onFinished();
@@ -26980,7 +27671,7 @@ var require_axios = __commonJS({
26980
27671
  boundary: userBoundary && userBoundary[1] || void 0
26981
27672
  });
26982
27673
  } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
26983
- headers.set(data.getHeaders());
27674
+ setFormDataHeaders$1(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
26984
27675
  if (!headers.hasContentLength()) {
26985
27676
  try {
26986
27677
  const knownLength = await util.promisify(data.getLength).call(data);
@@ -27032,8 +27723,8 @@ var require_axios = __commonJS({
27032
27723
  auth = username + ":" + password;
27033
27724
  }
27034
27725
  if (!auth && parsed.username) {
27035
- const urlUsername = parsed.username;
27036
- const urlPassword = parsed.password;
27726
+ const urlUsername = decodeURIComponentSafe(parsed.username);
27727
+ const urlPassword = decodeURIComponentSafe(parsed.password);
27037
27728
  auth = urlUsername + ":" + urlPassword;
27038
27729
  }
27039
27730
  auth && headers.delete("authorization");
@@ -27051,7 +27742,7 @@ var require_axios = __commonJS({
27051
27742
  const options = Object.assign(/* @__PURE__ */ Object.create(null), {
27052
27743
  path: path$1,
27053
27744
  method,
27054
- headers: headers.toJSON(),
27745
+ headers: toByteStringHeaderObject(headers),
27055
27746
  agents: {
27056
27747
  http: config.httpAgent,
27057
27748
  https: config.httpsAgent
@@ -27080,11 +27771,14 @@ var require_axios = __commonJS({
27080
27771
  } else {
27081
27772
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
27082
27773
  options.port = parsed.port;
27083
- setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
27774
+ setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, config.httpsAgent);
27084
27775
  }
27085
27776
  let transport;
27777
+ let isNativeTransport = false;
27086
27778
  const isHttpsRequest = isHttps.test(options.protocol);
27087
- options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
27779
+ if (options.agent == null) {
27780
+ options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
27781
+ }
27088
27782
  if (isHttp2) {
27089
27783
  transport = http2Transport;
27090
27784
  } else {
@@ -27093,6 +27787,7 @@ var require_axios = __commonJS({
27093
27787
  transport = configTransport;
27094
27788
  } else if (config.maxRedirects === 0) {
27095
27789
  transport = isHttpsRequest ? https : http;
27790
+ isNativeTransport = true;
27096
27791
  } else {
27097
27792
  if (config.maxRedirects) {
27098
27793
  options.maxRedirects = config.maxRedirects;
@@ -27111,6 +27806,7 @@ var require_axios = __commonJS({
27111
27806
  }
27112
27807
  options.insecureHTTPParser = Boolean(own2("insecureHTTPParser"));
27113
27808
  req = transport.request(options, function handleResponse(res) {
27809
+ clearConnectPhaseTimer();
27114
27810
  if (req.destroyed) return;
27115
27811
  const streams = [res];
27116
27812
  const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]);
@@ -27192,13 +27888,13 @@ var require_axios = __commonJS({
27192
27888
  if (rejected) {
27193
27889
  return;
27194
27890
  }
27195
- const err = new AxiosError("stream has been aborted", AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
27891
+ const err = new AxiosError("stream has been aborted", AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response);
27196
27892
  responseStream.destroy(err);
27197
27893
  reject(err);
27198
27894
  });
27199
27895
  responseStream.on("error", function handleStreamError(err) {
27200
- if (req.destroyed) return;
27201
- reject(AxiosError.from(err, null, config, lastRequest));
27896
+ if (rejected) return;
27897
+ reject(AxiosError.from(err, null, config, lastRequest, response));
27202
27898
  });
27203
27899
  responseStream.on("end", function handleStreamEnd() {
27204
27900
  try {
@@ -27233,6 +27929,7 @@ var require_axios = __commonJS({
27233
27929
  req.on("error", function handleRequestError(err) {
27234
27930
  reject(AxiosError.from(err, null, config, req));
27235
27931
  });
27932
+ const boundSockets = /* @__PURE__ */ new Set();
27236
27933
  req.on("socket", function handleRequestSocket(socket) {
27237
27934
  socket.setKeepAlive(true, 1e3 * 60);
27238
27935
  if (!socket[kAxiosSocketListener]) {
@@ -27245,11 +27942,16 @@ var require_axios = __commonJS({
27245
27942
  socket[kAxiosSocketListener] = true;
27246
27943
  }
27247
27944
  socket[kAxiosCurrentReq] = req;
27248
- req.once("close", function clearCurrentReq() {
27945
+ boundSockets.add(socket);
27946
+ });
27947
+ req.once("close", function clearCurrentReq() {
27948
+ clearConnectPhaseTimer();
27949
+ for (const socket of boundSockets) {
27249
27950
  if (socket[kAxiosCurrentReq] === req) {
27250
27951
  socket[kAxiosCurrentReq] = null;
27251
27952
  }
27252
- });
27953
+ }
27954
+ boundSockets.clear();
27253
27955
  });
27254
27956
  if (config.timeout) {
27255
27957
  const timeout = parseInt(config.timeout, 10);
@@ -27257,15 +27959,14 @@ var require_axios = __commonJS({
27257
27959
  abort(new AxiosError("error trying to parse `config.timeout` to int", AxiosError.ERR_BAD_OPTION_VALUE, config, req));
27258
27960
  return;
27259
27961
  }
27260
- req.setTimeout(timeout, function handleRequestTimeout() {
27962
+ const handleTimeout = function handleTimeout2() {
27261
27963
  if (isDone) return;
27262
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
27263
- const transitional = config.transitional || transitionalDefaults;
27264
- if (config.timeoutErrorMessage) {
27265
- timeoutErrorMessage = config.timeoutErrorMessage;
27266
- }
27267
- abort(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req));
27268
- });
27964
+ abort(createTimeoutError());
27965
+ };
27966
+ if (isNativeTransport && timeout > 0) {
27967
+ connectPhaseTimer = setTimeout(handleTimeout, timeout);
27968
+ }
27969
+ req.setTimeout(timeout, handleTimeout);
27269
27970
  } else {
27270
27971
  req.setTimeout(0);
27271
27972
  }
@@ -27337,8 +28038,15 @@ var require_axios = __commonJS({
27337
28038
  },
27338
28039
  read(name) {
27339
28040
  if (typeof document === "undefined") return null;
27340
- const match2 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
27341
- return match2 ? decodeURIComponent(match2[1]) : null;
28041
+ const cookies2 = document.cookie.split(";");
28042
+ for (let i = 0; i < cookies2.length; i++) {
28043
+ const cookie = cookies2[i].replace(/^\s+/, "");
28044
+ const eq = cookie.indexOf("=");
28045
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
28046
+ return decodeURIComponent(cookie.slice(eq + 1));
28047
+ }
28048
+ }
28049
+ return null;
27342
28050
  },
27343
28051
  remove(name) {
27344
28052
  this.write(name, "", Date.now() - 864e5, "/");
@@ -27363,6 +28071,9 @@ var require_axios = __commonJS({
27363
28071
  config2 = config2 || {};
27364
28072
  const config = /* @__PURE__ */ Object.create(null);
27365
28073
  Object.defineProperty(config, "hasOwnProperty", {
28074
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
28075
+ // this data descriptor into an accessor descriptor on the way in.
28076
+ __proto__: null,
27366
28077
  value: Object.prototype.hasOwnProperty,
27367
28078
  enumerable: false,
27368
28079
  writable: true,
@@ -27451,6 +28162,19 @@ var require_axios = __commonJS({
27451
28162
  });
27452
28163
  return config;
27453
28164
  }
28165
+ var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
28166
+ function setFormDataHeaders(headers, formHeaders, policy) {
28167
+ if (policy !== "content-only") {
28168
+ headers.set(formHeaders);
28169
+ return;
28170
+ }
28171
+ Object.entries(formHeaders).forEach(([key, val]) => {
28172
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
28173
+ headers.set(key, val);
28174
+ }
28175
+ });
28176
+ }
28177
+ var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
27454
28178
  var resolveConfig = (config) => {
27455
28179
  const newConfig = mergeConfig({}, config);
27456
28180
  const own2 = (key) => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
@@ -27466,19 +28190,13 @@ var require_axios = __commonJS({
27466
28190
  newConfig.headers = headers = AxiosHeaders.from(headers);
27467
28191
  newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls), config.params, config.paramsSerializer);
27468
28192
  if (auth) {
27469
- headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
28193
+ headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : "")));
27470
28194
  }
27471
28195
  if (utils$1.isFormData(data)) {
27472
28196
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
27473
28197
  headers.setContentType(void 0);
27474
28198
  } else if (utils$1.isFunction(data.getHeaders)) {
27475
- const formHeaders = data.getHeaders();
27476
- const allowedHeaders = ["content-type", "content-length"];
27477
- Object.entries(formHeaders).forEach(([key, val]) => {
27478
- if (allowedHeaders.includes(key.toLowerCase())) {
27479
- headers.set(key, val);
27480
- }
27481
- });
28199
+ setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
27482
28200
  }
27483
28201
  }
27484
28202
  if (platform.hasStandardBrowserEnv) {
@@ -27548,7 +28266,7 @@ var require_axios = __commonJS({
27548
28266
  if (!request || request.readyState !== 4) {
27549
28267
  return;
27550
28268
  }
27551
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
28269
+ if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) {
27552
28270
  return;
27553
28271
  }
27554
28272
  setTimeout(onloadend);
@@ -27559,6 +28277,7 @@ var require_axios = __commonJS({
27559
28277
  return;
27560
28278
  }
27561
28279
  reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
28280
+ done();
27562
28281
  request = null;
27563
28282
  };
27564
28283
  request.onerror = function handleError(event) {
@@ -27566,6 +28285,7 @@ var require_axios = __commonJS({
27566
28285
  const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
27567
28286
  err.event = event || null;
27568
28287
  reject(err);
28288
+ done();
27569
28289
  request = null;
27570
28290
  };
27571
28291
  request.ontimeout = function handleTimeout() {
@@ -27575,11 +28295,12 @@ var require_axios = __commonJS({
27575
28295
  timeoutErrorMessage = _config.timeoutErrorMessage;
27576
28296
  }
27577
28297
  reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
28298
+ done();
27578
28299
  request = null;
27579
28300
  };
27580
28301
  requestData === void 0 && requestHeaders.setContentType(null);
27581
28302
  if ("setRequestHeader" in request) {
27582
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
28303
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
27583
28304
  request.setRequestHeader(key, val);
27584
28305
  });
27585
28306
  }
@@ -27605,6 +28326,7 @@ var require_axios = __commonJS({
27605
28326
  }
27606
28327
  reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
27607
28328
  request.abort();
28329
+ done();
27608
28330
  request = null;
27609
28331
  };
27610
28332
  _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
@@ -27613,7 +28335,7 @@ var require_axios = __commonJS({
27613
28335
  }
27614
28336
  }
27615
28337
  const protocol = parseProtocol(_config.url);
27616
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
28338
+ if (protocol && !platform.protocols.includes(protocol)) {
27617
28339
  reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
27618
28340
  return;
27619
28341
  }
@@ -27621,41 +28343,41 @@ var require_axios = __commonJS({
27621
28343
  });
27622
28344
  };
27623
28345
  var composeSignals = (signals, timeout) => {
27624
- const {
27625
- length
27626
- } = signals = signals ? signals.filter(Boolean) : [];
27627
- if (timeout || length) {
27628
- let controller = new AbortController();
27629
- let aborted;
27630
- const onabort = function(reason) {
27631
- if (!aborted) {
27632
- aborted = true;
27633
- unsubscribe();
27634
- const err = reason instanceof Error ? reason : this.reason;
27635
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
27636
- }
27637
- };
27638
- let timer = timeout && setTimeout(() => {
27639
- timer = null;
27640
- onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
27641
- }, timeout);
27642
- const unsubscribe = () => {
27643
- if (signals) {
27644
- timer && clearTimeout(timer);
27645
- timer = null;
27646
- signals.forEach((signal2) => {
27647
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
27648
- });
27649
- signals = null;
27650
- }
27651
- };
27652
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
27653
- const {
27654
- signal
27655
- } = controller;
27656
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
27657
- return signal;
28346
+ signals = signals ? signals.filter(Boolean) : [];
28347
+ if (!timeout && !signals.length) {
28348
+ return;
27658
28349
  }
28350
+ const controller = new AbortController();
28351
+ let aborted = false;
28352
+ const onabort = function(reason) {
28353
+ if (!aborted) {
28354
+ aborted = true;
28355
+ unsubscribe();
28356
+ const err = reason instanceof Error ? reason : this.reason;
28357
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
28358
+ }
28359
+ };
28360
+ let timer = timeout && setTimeout(() => {
28361
+ timer = null;
28362
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
28363
+ }, timeout);
28364
+ const unsubscribe = () => {
28365
+ if (!signals) {
28366
+ return;
28367
+ }
28368
+ timer && clearTimeout(timer);
28369
+ timer = null;
28370
+ signals.forEach((signal2) => {
28371
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
28372
+ });
28373
+ signals = null;
28374
+ };
28375
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
28376
+ const {
28377
+ signal
28378
+ } = controller;
28379
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
28380
+ return signal;
27659
28381
  };
27660
28382
  var streamChunk = function* (chunk, chunkSize) {
27661
28383
  let len = chunk.byteLength;
@@ -27742,17 +28464,6 @@ var require_axios = __commonJS({
27742
28464
  var {
27743
28465
  isFunction
27744
28466
  } = utils$1;
27745
- var globalFetchAPI = (({
27746
- Request,
27747
- Response
27748
- }) => ({
27749
- Request,
27750
- Response
27751
- }))(utils$1.global);
27752
- var {
27753
- ReadableStream: ReadableStream$1,
27754
- TextEncoder: TextEncoder$1
27755
- } = utils$1.global;
27756
28467
  var test = (fn, ...args) => {
27757
28468
  try {
27758
28469
  return !!fn(...args);
@@ -27761,9 +28472,17 @@ var require_axios = __commonJS({
27761
28472
  }
27762
28473
  };
27763
28474
  var factory = (env) => {
28475
+ const globalObject2 = utils$1.global !== void 0 && utils$1.global !== null ? utils$1.global : globalThis;
28476
+ const {
28477
+ ReadableStream: ReadableStream2,
28478
+ TextEncoder: TextEncoder2
28479
+ } = globalObject2;
27764
28480
  env = utils$1.merge.call({
27765
28481
  skipUndefined: true
27766
- }, globalFetchAPI, env);
28482
+ }, {
28483
+ Request: globalObject2.Request,
28484
+ Response: globalObject2.Response
28485
+ }, env);
27767
28486
  const {
27768
28487
  fetch: envFetch,
27769
28488
  Request,
@@ -27775,12 +28494,12 @@ var require_axios = __commonJS({
27775
28494
  if (!isFetchSupported) {
27776
28495
  return false;
27777
28496
  }
27778
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
27779
- const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
28497
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream2);
28498
+ const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
27780
28499
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
27781
28500
  let duplexAccessed = false;
27782
28501
  const request = new Request(platform.origin, {
27783
- body: new ReadableStream$1(),
28502
+ body: new ReadableStream2(),
27784
28503
  method: "POST",
27785
28504
  get duplex() {
27786
28505
  duplexAccessed = true;
@@ -27849,8 +28568,12 @@ var require_axios = __commonJS({
27849
28568
  responseType,
27850
28569
  headers,
27851
28570
  withCredentials = "same-origin",
27852
- fetchOptions
28571
+ fetchOptions,
28572
+ maxContentLength,
28573
+ maxBodyLength
27853
28574
  } = resolveConfig(config);
28575
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
28576
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
27854
28577
  let _fetch = envFetch || fetch;
27855
28578
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
27856
28579
  let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
@@ -27860,6 +28583,18 @@ var require_axios = __commonJS({
27860
28583
  });
27861
28584
  let requestContentLength;
27862
28585
  try {
28586
+ if (hasMaxContentLength && typeof url2 === "string" && url2.startsWith("data:")) {
28587
+ const estimated = estimateDataURLDecodedBytes(url2);
28588
+ if (estimated > maxContentLength) {
28589
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
28590
+ }
28591
+ }
28592
+ if (hasMaxBodyLength && method !== "get" && method !== "head") {
28593
+ const outboundLength = await resolveBodyLength(headers, data);
28594
+ if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) {
28595
+ throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
28596
+ }
28597
+ }
27863
28598
  if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
27864
28599
  let _request = new Request(url2, {
27865
28600
  method: "POST",
@@ -27885,32 +28620,64 @@ var require_axios = __commonJS({
27885
28620
  headers.delete("content-type");
27886
28621
  }
27887
28622
  }
28623
+ headers.set("User-Agent", "axios/" + VERSION2, false);
27888
28624
  const resolvedOptions = {
27889
28625
  ...fetchOptions,
27890
28626
  signal: composedSignal,
27891
28627
  method: method.toUpperCase(),
27892
- headers: headers.normalize().toJSON(),
28628
+ headers: toByteStringHeaderObject(headers.normalize()),
27893
28629
  body: data,
27894
28630
  duplex: "half",
27895
28631
  credentials: isCredentialsSupported ? withCredentials : void 0
27896
28632
  };
27897
28633
  request = isRequestSupported && new Request(url2, resolvedOptions);
27898
28634
  let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
28635
+ if (hasMaxContentLength) {
28636
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
28637
+ if (declaredLength != null && declaredLength > maxContentLength) {
28638
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
28639
+ }
28640
+ }
27899
28641
  const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
27900
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
28642
+ if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
27901
28643
  const options = {};
27902
28644
  ["status", "statusText", "headers"].forEach((prop) => {
27903
28645
  options[prop] = response[prop];
27904
28646
  });
27905
28647
  const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
27906
28648
  const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
27907
- response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
28649
+ let bytesRead = 0;
28650
+ const onChunkProgress = (loadedBytes) => {
28651
+ if (hasMaxContentLength) {
28652
+ bytesRead = loadedBytes;
28653
+ if (bytesRead > maxContentLength) {
28654
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
28655
+ }
28656
+ }
28657
+ onProgress && onProgress(loadedBytes);
28658
+ };
28659
+ response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
27908
28660
  flush && flush();
27909
28661
  unsubscribe && unsubscribe();
27910
28662
  }), options);
27911
28663
  }
27912
28664
  responseType = responseType || "text";
27913
28665
  let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
28666
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
28667
+ let materializedSize;
28668
+ if (responseData != null) {
28669
+ if (typeof responseData.byteLength === "number") {
28670
+ materializedSize = responseData.byteLength;
28671
+ } else if (typeof responseData.size === "number") {
28672
+ materializedSize = responseData.size;
28673
+ } else if (typeof responseData === "string") {
28674
+ materializedSize = typeof TextEncoder2 === "function" ? new TextEncoder2().encode(responseData).byteLength : responseData.length;
28675
+ }
28676
+ }
28677
+ if (typeof materializedSize === "number" && materializedSize > maxContentLength) {
28678
+ throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
28679
+ }
28680
+ }
27914
28681
  !isStreamResponse && unsubscribe && unsubscribe();
27915
28682
  return await new Promise((resolve, reject) => {
27916
28683
  settle(resolve, reject, {
@@ -27924,6 +28691,13 @@ var require_axios = __commonJS({
27924
28691
  });
27925
28692
  } catch (err) {
27926
28693
  unsubscribe && unsubscribe();
28694
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
28695
+ const canceledError = composedSignal.reason;
28696
+ canceledError.config = config;
28697
+ request && (canceledError.request = request);
28698
+ err !== canceledError && (canceledError.cause = err);
28699
+ throw canceledError;
28700
+ }
27927
28701
  if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
27928
28702
  throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), {
27929
28703
  cause: err.cause || err
@@ -27963,11 +28737,13 @@ var require_axios = __commonJS({
27963
28737
  if (fn) {
27964
28738
  try {
27965
28739
  Object.defineProperty(fn, "name", {
28740
+ __proto__: null,
27966
28741
  value
27967
28742
  });
27968
28743
  } catch (e) {
27969
28744
  }
27970
28745
  Object.defineProperty(fn, "adapterName", {
28746
+ __proto__: null,
27971
28747
  value
27972
28748
  });
27973
28749
  }
@@ -28034,14 +28810,24 @@ var require_axios = __commonJS({
28034
28810
  const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
28035
28811
  return adapter(config).then(function onAdapterResolution(response) {
28036
28812
  throwIfCancellationRequested(config);
28037
- response.data = transformData.call(config, config.transformResponse, response);
28813
+ config.response = response;
28814
+ try {
28815
+ response.data = transformData.call(config, config.transformResponse, response);
28816
+ } finally {
28817
+ delete config.response;
28818
+ }
28038
28819
  response.headers = AxiosHeaders.from(response.headers);
28039
28820
  return response;
28040
28821
  }, function onAdapterRejection(reason) {
28041
28822
  if (!isCancel(reason)) {
28042
28823
  throwIfCancellationRequested(config);
28043
28824
  if (reason && reason.response) {
28044
- reason.response.data = transformData.call(config, config.transformResponse, reason.response);
28825
+ config.response = reason.response;
28826
+ try {
28827
+ reason.response.data = transformData.call(config, config.transformResponse, reason.response);
28828
+ } finally {
28829
+ delete config.response;
28830
+ }
28045
28831
  reason.response.headers = AxiosHeaders.from(reason.response.headers);
28046
28832
  }
28047
28833
  }
@@ -28195,7 +28981,7 @@ var require_axios = __commonJS({
28195
28981
  }, true);
28196
28982
  config.method = (config.method || this.defaults.method || "get").toLowerCase();
28197
28983
  let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
28198
- headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
28984
+ headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => {
28199
28985
  delete headers[method];
28200
28986
  });
28201
28987
  config.headers = AxiosHeaders.concat(contextHeaders, headers);
@@ -28271,7 +29057,7 @@ var require_axios = __commonJS({
28271
29057
  }));
28272
29058
  };
28273
29059
  });
28274
- utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
29060
+ utils$1.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
28275
29061
  function generateHTTPMethod(isForm) {
28276
29062
  return function httpMethod(url2, data, config) {
28277
29063
  return this.request(mergeConfig(config || {}, {
@@ -28285,7 +29071,9 @@ var require_axios = __commonJS({
28285
29071
  };
28286
29072
  }
28287
29073
  Axios.prototype[method] = generateHTTPMethod();
28288
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
29074
+ if (method !== "query") {
29075
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
29076
+ }
28289
29077
  });
28290
29078
  var CancelToken = class _CancelToken {
28291
29079
  constructor(executor) {
@@ -28510,8 +29298,17 @@ var require_url = __commonJS({
28510
29298
  return mod && mod.__esModule ? mod : { "default": mod };
28511
29299
  };
28512
29300
  Object.defineProperty(exports, "__esModule", { value: true });
29301
+ exports.isValidUrl = isValidUrl;
28513
29302
  exports.checkUrlExists = checkUrlExists;
28514
29303
  var axios_1 = __importDefault(require_axios());
29304
+ function isValidUrl(url) {
29305
+ try {
29306
+ new URL(url);
29307
+ return true;
29308
+ } catch {
29309
+ return false;
29310
+ }
29311
+ }
28515
29312
  async function checkUrlExists(url) {
28516
29313
  return axios_1.default.request({ url, method: "HEAD" }).then((response) => response.status);
28517
29314
  }
@@ -28519,7 +29316,7 @@ var require_url = __commonJS({
28519
29316
  });
28520
29317
 
28521
29318
  // node_modules/@sap-cloud-sdk/util/dist/index.js
28522
- var require_dist = __commonJS({
29319
+ var require_dist2 = __commonJS({
28523
29320
  "node_modules/@sap-cloud-sdk/util/dist/index.js"(exports) {
28524
29321
  "use strict";
28525
29322
  var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
@@ -28601,6 +29398,36 @@ function validateModelParamsWithWarnings(params, warnings) {
28601
29398
  }
28602
29399
  }
28603
29400
  var sapAIApiTypeSchema = z.enum(["orchestration", "foundation-models"]);
29401
+ var cacheControlSchema = z.object({
29402
+ ttl: z.enum(["5m", "1h"]).optional(),
29403
+ type: z.literal("ephemeral")
29404
+ });
29405
+ var sapAIPartProviderOptionsSchema = z.object({
29406
+ cacheControl: cacheControlSchema.optional()
29407
+ });
29408
+ function parseSAPPartProviderOptions(providerOptions, warnings) {
29409
+ if (!providerOptions || typeof providerOptions !== "object") {
29410
+ return void 0;
29411
+ }
29412
+ const block = providerOptions[SAP_AI_PROVIDER_NAME];
29413
+ if (block === void 0) {
29414
+ return void 0;
29415
+ }
29416
+ const parsed = sapAIPartProviderOptionsSchema.safeParse(block);
29417
+ if (parsed.success) {
29418
+ return parsed.data;
29419
+ }
29420
+ if (warnings) {
29421
+ for (const issue of parsed.error.issues) {
29422
+ const path = issue.path.join(".");
29423
+ const message = `providerOptions['sap-ai']${path ? `.${path}` : ""} is invalid: ${issue.message}. The directive was dropped.`;
29424
+ if (!warnings.some((w) => w.message === message)) {
29425
+ warnings.push({ message, type: "other" });
29426
+ }
29427
+ }
29428
+ }
29429
+ return void 0;
29430
+ }
28604
29431
  var promptTemplateScopeSchema = z.enum(["tenant", "resource_group"]);
28605
29432
  var promptTemplateRefByIdSchema = z.object({
28606
29433
  id: z.string().min(1, "Template ID cannot be empty"),
@@ -28713,7 +29540,7 @@ function mergeTwo(target, source, ancestors, depth) {
28713
29540
  }
28714
29541
 
28715
29542
  // src/sap-ai-error.ts
28716
- var import_util = __toESM(require_dist(), 1);
29543
+ var import_util = __toESM(require_dist2(), 1);
28717
29544
  import { APICallError, LoadAPIKeyError, NoSuchModelError } from "@ai-sdk/provider";
28718
29545
  var HTTP_STATUS = {
28719
29546
  BAD_REQUEST: 400,
@@ -29020,15 +29847,23 @@ See: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-depl
29020
29847
  }
29021
29848
  function normalizeHeaders(headers) {
29022
29849
  if (!headers || typeof headers !== "object") return void 0;
29850
+ if (typeof Headers !== "undefined" && headers instanceof Headers) {
29851
+ const out = {};
29852
+ headers.forEach((value, key) => {
29853
+ out[key.toLowerCase()] = value;
29854
+ });
29855
+ return Object.keys(out).length === 0 ? void 0 : out;
29856
+ }
29023
29857
  const record = headers;
29024
29858
  const entries = Object.entries(record).flatMap(([key, value]) => {
29025
- if (typeof value === "string") return [[key, value]];
29859
+ const k = key.toLowerCase();
29860
+ if (typeof value === "string") return [[k, value]];
29026
29861
  if (Array.isArray(value)) {
29027
29862
  const strings = value.filter((item) => typeof item === "string").join("; ");
29028
- return strings.length > 0 ? [[key, strings]] : [];
29863
+ return strings.length > 0 ? [[k, strings]] : [];
29029
29864
  }
29030
29865
  if (typeof value === "number" || typeof value === "boolean") {
29031
- return [[key, String(value)]];
29866
+ return [[k, String(value)]];
29032
29867
  }
29033
29868
  return [];
29034
29869
  });
@@ -29204,10 +30039,23 @@ function serializeAxiosResponseData(data, maxLength = 2e3) {
29204
30039
  return serialized;
29205
30040
  }
29206
30041
  function tryExtractSAPErrorFromMessage(message) {
29207
- const jsonMatch = /\{[\s\S]*\}/.exec(message);
29208
- if (!jsonMatch) return null;
30042
+ const startIdx = message.indexOf("{");
30043
+ if (startIdx === -1) return null;
30044
+ let depth = 0;
30045
+ let endIdx = -1;
30046
+ for (let i = startIdx; i < message.length; i++) {
30047
+ if (message[i] === "{") depth++;
30048
+ else if (message[i] === "}") {
30049
+ depth--;
30050
+ if (depth === 0) {
30051
+ endIdx = i;
30052
+ break;
30053
+ }
30054
+ }
30055
+ }
30056
+ if (endIdx === -1) return null;
29209
30057
  try {
29210
- const parsed = JSON.parse(jsonMatch[0]);
30058
+ const parsed = JSON.parse(message.slice(startIdx, endIdx + 1));
29211
30059
  if (parsed && typeof parsed === "object" && "error" in parsed) {
29212
30060
  return parsed;
29213
30061
  }
@@ -29221,7 +30069,7 @@ function tryExtractSAPErrorFromMessage(message) {
29221
30069
  }
29222
30070
 
29223
30071
  // src/version.ts
29224
- var VERSION = true ? "4.6.9" : "0.0.0-test";
30072
+ var VERSION = true ? "4.7.0" : "0.0.0-test";
29225
30073
 
29226
30074
  export {
29227
30075
  __toESM,
@@ -29230,11 +30078,12 @@ export {
29230
30078
  validateEmbeddingModelParamsSettings,
29231
30079
  validateModelParamsSettings,
29232
30080
  validateModelParamsWithWarnings,
30081
+ parseSAPPartProviderOptions,
29233
30082
  orchestrationConfigRefSchema,
29234
30083
  sapAILanguageModelProviderOptions,
29235
30084
  sapAIEmbeddingProviderOptions,
29236
30085
  deepMerge,
29237
- require_dist,
30086
+ require_dist2 as require_dist,
29238
30087
  ApiSwitchError,
29239
30088
  UnsupportedFeatureError,
29240
30089
  convertToAISDKError,
@@ -29272,6 +30121,6 @@ mime-types/index.js:
29272
30121
  *)
29273
30122
 
29274
30123
  axios/dist/node/axios.cjs:
29275
- (*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors *)
30124
+ (*! Axios v1.16.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
29276
30125
  */
29277
- //# sourceMappingURL=chunk-F4MUYVQJ.js.map
30126
+ //# sourceMappingURL=chunk-TVXWNZQT.js.map