@dstny/scp-authenticator 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -14,6 +14,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
14
14
  var __commonJS = (cb, mod) => function __require2() {
15
15
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
16
  };
17
+ var __export = (target, all3) => {
18
+ for (var name in all3)
19
+ __defProp(target, name, { get: all3[name], enumerable: true });
20
+ };
17
21
  var __copyProps = (to, from, except, desc) => {
18
22
  if (from && typeof from === "object" || typeof from === "function") {
19
23
  for (let key of __getOwnPropNames(from))
@@ -36,7 +40,7 @@ var require_delayed_stream = __commonJS({
36
40
  "../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
37
41
  "use strict";
38
42
  var Stream = __require("stream").Stream;
39
- var util = __require("util");
43
+ var util3 = __require("util");
40
44
  module.exports = DelayedStream;
41
45
  function DelayedStream() {
42
46
  this.source = null;
@@ -47,7 +51,7 @@ var require_delayed_stream = __commonJS({
47
51
  this._released = false;
48
52
  this._bufferedEvents = [];
49
53
  }
50
- util.inherits(DelayedStream, Stream);
54
+ util3.inherits(DelayedStream, Stream);
51
55
  DelayedStream.create = function(source, options) {
52
56
  var delayedStream = new this();
53
57
  options = options || {};
@@ -127,7 +131,7 @@ var require_delayed_stream = __commonJS({
127
131
  var require_combined_stream = __commonJS({
128
132
  "../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports, module) {
129
133
  "use strict";
130
- var util = __require("util");
134
+ var util3 = __require("util");
131
135
  var Stream = __require("stream").Stream;
132
136
  var DelayedStream = require_delayed_stream();
133
137
  module.exports = CombinedStream;
@@ -143,7 +147,7 @@ var require_combined_stream = __commonJS({
143
147
  this._insideLoop = false;
144
148
  this._pendingNext = false;
145
149
  }
146
- util.inherits(CombinedStream, Stream);
150
+ util3.inherits(CombinedStream, Stream);
147
151
  CombinedStream.create = function(options) {
148
152
  var combinedStream = new this();
149
153
  options = options || {};
@@ -152,26 +156,26 @@ var require_combined_stream = __commonJS({
152
156
  }
153
157
  return combinedStream;
154
158
  };
155
- CombinedStream.isStreamLike = function(stream3) {
156
- return typeof stream3 !== "function" && typeof stream3 !== "string" && typeof stream3 !== "boolean" && typeof stream3 !== "number" && !Buffer.isBuffer(stream3);
159
+ CombinedStream.isStreamLike = function(stream4) {
160
+ return typeof stream4 !== "function" && typeof stream4 !== "string" && typeof stream4 !== "boolean" && typeof stream4 !== "number" && !Buffer.isBuffer(stream4);
157
161
  };
158
- CombinedStream.prototype.append = function(stream3) {
159
- var isStreamLike = CombinedStream.isStreamLike(stream3);
162
+ CombinedStream.prototype.append = function(stream4) {
163
+ var isStreamLike = CombinedStream.isStreamLike(stream4);
160
164
  if (isStreamLike) {
161
- if (!(stream3 instanceof DelayedStream)) {
162
- var newStream = DelayedStream.create(stream3, {
165
+ if (!(stream4 instanceof DelayedStream)) {
166
+ var newStream = DelayedStream.create(stream4, {
163
167
  maxDataSize: Infinity,
164
168
  pauseStream: this.pauseStreams
165
169
  });
166
- stream3.on("data", this._checkDataSize.bind(this));
167
- stream3 = newStream;
170
+ stream4.on("data", this._checkDataSize.bind(this));
171
+ stream4 = newStream;
168
172
  }
169
- this._handleErrors(stream3);
173
+ this._handleErrors(stream4);
170
174
  if (this.pauseStreams) {
171
- stream3.pause();
175
+ stream4.pause();
172
176
  }
173
177
  }
174
- this._streams.push(stream3);
178
+ this._streams.push(stream4);
175
179
  return this;
176
180
  };
177
181
  CombinedStream.prototype.pipe = function(dest, options) {
@@ -196,40 +200,40 @@ var require_combined_stream = __commonJS({
196
200
  }
197
201
  };
198
202
  CombinedStream.prototype._realGetNext = function() {
199
- var stream3 = this._streams.shift();
200
- if (typeof stream3 == "undefined") {
203
+ var stream4 = this._streams.shift();
204
+ if (typeof stream4 == "undefined") {
201
205
  this.end();
202
206
  return;
203
207
  }
204
- if (typeof stream3 !== "function") {
205
- this._pipeNext(stream3);
208
+ if (typeof stream4 !== "function") {
209
+ this._pipeNext(stream4);
206
210
  return;
207
211
  }
208
- var getStream = stream3;
209
- getStream(function(stream4) {
210
- var isStreamLike = CombinedStream.isStreamLike(stream4);
212
+ var getStream = stream4;
213
+ getStream(function(stream5) {
214
+ var isStreamLike = CombinedStream.isStreamLike(stream5);
211
215
  if (isStreamLike) {
212
- stream4.on("data", this._checkDataSize.bind(this));
213
- this._handleErrors(stream4);
216
+ stream5.on("data", this._checkDataSize.bind(this));
217
+ this._handleErrors(stream5);
214
218
  }
215
- this._pipeNext(stream4);
219
+ this._pipeNext(stream5);
216
220
  }.bind(this));
217
221
  };
218
- CombinedStream.prototype._pipeNext = function(stream3) {
219
- this._currentStream = stream3;
220
- var isStreamLike = CombinedStream.isStreamLike(stream3);
222
+ CombinedStream.prototype._pipeNext = function(stream4) {
223
+ this._currentStream = stream4;
224
+ var isStreamLike = CombinedStream.isStreamLike(stream4);
221
225
  if (isStreamLike) {
222
- stream3.on("end", this._getNext.bind(this));
223
- stream3.pipe(this, { end: false });
226
+ stream4.on("end", this._getNext.bind(this));
227
+ stream4.pipe(this, { end: false });
224
228
  return;
225
229
  }
226
- var value = stream3;
230
+ var value = stream4;
227
231
  this.write(value);
228
232
  this._getNext();
229
233
  };
230
- CombinedStream.prototype._handleErrors = function(stream3) {
234
+ CombinedStream.prototype._handleErrors = function(stream4) {
231
235
  var self2 = this;
232
- stream3.on("error", function(err) {
236
+ stream4.on("error", function(err) {
233
237
  self2._emitError(err);
234
238
  });
235
239
  };
@@ -278,11 +282,11 @@ var require_combined_stream = __commonJS({
278
282
  CombinedStream.prototype._updateDataSize = function() {
279
283
  this.dataSize = 0;
280
284
  var self2 = this;
281
- this._streams.forEach(function(stream3) {
282
- if (!stream3.dataSize) {
285
+ this._streams.forEach(function(stream4) {
286
+ if (!stream4.dataSize) {
283
287
  return;
284
288
  }
285
- self2.dataSize += stream3.dataSize;
289
+ self2.dataSize += stream4.dataSize;
286
290
  });
287
291
  if (this._currentStream && this._currentStream.dataSize) {
288
292
  this.dataSize += this._currentStream.dataSize;
@@ -8983,9 +8987,9 @@ var require_iterate = __commonJS({
8983
8987
  var async = require_async();
8984
8988
  var abort = require_abort();
8985
8989
  module.exports = iterate;
8986
- function iterate(list, iterator2, state, callback) {
8990
+ function iterate(list, iterator3, state, callback) {
8987
8991
  var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
8988
- state.jobs[key] = runJob(iterator2, key, list[key], function(error, output) {
8992
+ state.jobs[key] = runJob(iterator3, key, list[key], function(error, output) {
8989
8993
  if (!(key in state.jobs)) {
8990
8994
  return;
8991
8995
  }
@@ -8998,12 +9002,12 @@ var require_iterate = __commonJS({
8998
9002
  callback(error, state.results);
8999
9003
  });
9000
9004
  }
9001
- function runJob(iterator2, key, item, callback) {
9005
+ function runJob(iterator3, key, item, callback) {
9002
9006
  var aborter;
9003
- if (iterator2.length == 2) {
9004
- aborter = iterator2(item, async(callback));
9007
+ if (iterator3.length == 2) {
9008
+ aborter = iterator3(item, async(callback));
9005
9009
  } else {
9006
- aborter = iterator2(item, key, async(callback));
9010
+ aborter = iterator3(item, key, async(callback));
9007
9011
  }
9008
9012
  return aborter;
9009
9013
  }
@@ -9059,10 +9063,10 @@ var require_parallel = __commonJS({
9059
9063
  var initState = require_state();
9060
9064
  var terminator = require_terminator();
9061
9065
  module.exports = parallel;
9062
- function parallel(list, iterator2, callback) {
9066
+ function parallel(list, iterator3, callback) {
9063
9067
  var state = initState(list);
9064
9068
  while (state.index < (state["keyedList"] || list).length) {
9065
- iterate(list, iterator2, state, function(error, result) {
9069
+ iterate(list, iterator3, state, function(error, result) {
9066
9070
  if (error) {
9067
9071
  callback(error, result);
9068
9072
  return;
@@ -9089,16 +9093,16 @@ var require_serialOrdered = __commonJS({
9089
9093
  module.exports = serialOrdered;
9090
9094
  module.exports.ascending = ascending;
9091
9095
  module.exports.descending = descending;
9092
- function serialOrdered(list, iterator2, sortMethod, callback) {
9096
+ function serialOrdered(list, iterator3, sortMethod, callback) {
9093
9097
  var state = initState(list, sortMethod);
9094
- iterate(list, iterator2, state, function iteratorHandler(error, result) {
9098
+ iterate(list, iterator3, state, function iteratorHandler(error, result) {
9095
9099
  if (error) {
9096
9100
  callback(error, result);
9097
9101
  return;
9098
9102
  }
9099
9103
  state.index++;
9100
9104
  if (state.index < (state["keyedList"] || list).length) {
9101
- iterate(list, iterator2, state, iteratorHandler);
9105
+ iterate(list, iterator3, state, iteratorHandler);
9102
9106
  return;
9103
9107
  }
9104
9108
  callback(null, state.results);
@@ -9120,8 +9124,8 @@ var require_serial = __commonJS({
9120
9124
  "use strict";
9121
9125
  var serialOrdered = require_serialOrdered();
9122
9126
  module.exports = serial;
9123
- function serial(list, iterator2, callback) {
9124
- return serialOrdered(list, iterator2, null, callback);
9127
+ function serial(list, iterator3, callback) {
9128
+ return serialOrdered(list, iterator3, null, callback);
9125
9129
  }
9126
9130
  }
9127
9131
  });
@@ -9156,7 +9160,7 @@ var require_form_data = __commonJS({
9156
9160
  "../../node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js"(exports, module) {
9157
9161
  "use strict";
9158
9162
  var CombinedStream = require_combined_stream();
9159
- var util = __require("util");
9163
+ var util3 = __require("util");
9160
9164
  var path = __require("path");
9161
9165
  var http2 = __require("http");
9162
9166
  var https2 = __require("https");
@@ -9166,11 +9170,11 @@ var require_form_data = __commonJS({
9166
9170
  var mime = require_mime_types();
9167
9171
  var asynckit = require_asynckit();
9168
9172
  var populate = require_populate();
9169
- module.exports = FormData4;
9170
- util.inherits(FormData4, CombinedStream);
9171
- function FormData4(options) {
9172
- if (!(this instanceof FormData4)) {
9173
- return new FormData4(options);
9173
+ module.exports = FormData3;
9174
+ util3.inherits(FormData3, CombinedStream);
9175
+ function FormData3(options) {
9176
+ if (!(this instanceof FormData3)) {
9177
+ return new FormData3(options);
9174
9178
  }
9175
9179
  this._overheadLength = 0;
9176
9180
  this._valueLength = 0;
@@ -9181,9 +9185,9 @@ var require_form_data = __commonJS({
9181
9185
  this[option] = options[option];
9182
9186
  }
9183
9187
  }
9184
- FormData4.LINE_BREAK = "\r\n";
9185
- FormData4.DEFAULT_CONTENT_TYPE = "application/octet-stream";
9186
- FormData4.prototype.append = function(field, value, options) {
9188
+ FormData3.LINE_BREAK = "\r\n";
9189
+ FormData3.DEFAULT_CONTENT_TYPE = "application/octet-stream";
9190
+ FormData3.prototype.append = function(field, value, options) {
9187
9191
  options = options || {};
9188
9192
  if (typeof options == "string") {
9189
9193
  options = { filename: options };
@@ -9192,7 +9196,7 @@ var require_form_data = __commonJS({
9192
9196
  if (typeof value == "number") {
9193
9197
  value = "" + value;
9194
9198
  }
9195
- if (util.isArray(value)) {
9199
+ if (util3.isArray(value)) {
9196
9200
  this._error(new Error("Arrays are not supported."));
9197
9201
  return;
9198
9202
  }
@@ -9203,7 +9207,7 @@ var require_form_data = __commonJS({
9203
9207
  append2(footer);
9204
9208
  this._trackLength(header, value, options);
9205
9209
  };
9206
- FormData4.prototype._trackLength = function(header, value, options) {
9210
+ FormData3.prototype._trackLength = function(header, value, options) {
9207
9211
  var valueLength = 0;
9208
9212
  if (options.knownLength != null) {
9209
9213
  valueLength += +options.knownLength;
@@ -9213,7 +9217,7 @@ var require_form_data = __commonJS({
9213
9217
  valueLength = Buffer.byteLength(value);
9214
9218
  }
9215
9219
  this._valueLength += valueLength;
9216
- this._overheadLength += Buffer.byteLength(header) + FormData4.LINE_BREAK.length;
9220
+ this._overheadLength += Buffer.byteLength(header) + FormData3.LINE_BREAK.length;
9217
9221
  if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion")) && !(value instanceof Stream)) {
9218
9222
  return;
9219
9223
  }
@@ -9221,7 +9225,7 @@ var require_form_data = __commonJS({
9221
9225
  this._valuesToMeasure.push(value);
9222
9226
  }
9223
9227
  };
9224
- FormData4.prototype._lengthRetriever = function(value, callback) {
9228
+ FormData3.prototype._lengthRetriever = function(value, callback) {
9225
9229
  if (value.hasOwnProperty("fd")) {
9226
9230
  if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
9227
9231
  callback(null, value.end + 1 - (value.start ? value.start : 0));
@@ -9248,7 +9252,7 @@ var require_form_data = __commonJS({
9248
9252
  callback("Unknown stream");
9249
9253
  }
9250
9254
  };
9251
- FormData4.prototype._multiPartHeader = function(field, value, options) {
9255
+ FormData3.prototype._multiPartHeader = function(field, value, options) {
9252
9256
  if (typeof options.header == "string") {
9253
9257
  return options.header;
9254
9258
  }
@@ -9276,12 +9280,12 @@ var require_form_data = __commonJS({
9276
9280
  header = [header];
9277
9281
  }
9278
9282
  if (header.length) {
9279
- contents += prop + ": " + header.join("; ") + FormData4.LINE_BREAK;
9283
+ contents += prop + ": " + header.join("; ") + FormData3.LINE_BREAK;
9280
9284
  }
9281
9285
  }
9282
- return "--" + this.getBoundary() + FormData4.LINE_BREAK + contents + FormData4.LINE_BREAK;
9286
+ return "--" + this.getBoundary() + FormData3.LINE_BREAK + contents + FormData3.LINE_BREAK;
9283
9287
  };
9284
- FormData4.prototype._getContentDisposition = function(value, options) {
9288
+ FormData3.prototype._getContentDisposition = function(value, options) {
9285
9289
  var filename, contentDisposition;
9286
9290
  if (typeof options.filepath === "string") {
9287
9291
  filename = path.normalize(options.filepath).replace(/\\/g, "/");
@@ -9295,7 +9299,7 @@ var require_form_data = __commonJS({
9295
9299
  }
9296
9300
  return contentDisposition;
9297
9301
  };
9298
- FormData4.prototype._getContentType = function(value, options) {
9302
+ FormData3.prototype._getContentType = function(value, options) {
9299
9303
  var contentType = options.contentType;
9300
9304
  if (!contentType && value.name) {
9301
9305
  contentType = mime.lookup(value.name);
@@ -9310,13 +9314,13 @@ var require_form_data = __commonJS({
9310
9314
  contentType = mime.lookup(options.filepath || options.filename);
9311
9315
  }
9312
9316
  if (!contentType && typeof value == "object") {
9313
- contentType = FormData4.DEFAULT_CONTENT_TYPE;
9317
+ contentType = FormData3.DEFAULT_CONTENT_TYPE;
9314
9318
  }
9315
9319
  return contentType;
9316
9320
  };
9317
- FormData4.prototype._multiPartFooter = function() {
9321
+ FormData3.prototype._multiPartFooter = function() {
9318
9322
  return function(next) {
9319
- var footer = FormData4.LINE_BREAK;
9323
+ var footer = FormData3.LINE_BREAK;
9320
9324
  var lastPart = this._streams.length === 0;
9321
9325
  if (lastPart) {
9322
9326
  footer += this._lastBoundary();
@@ -9324,10 +9328,10 @@ var require_form_data = __commonJS({
9324
9328
  next(footer);
9325
9329
  }.bind(this);
9326
9330
  };
9327
- FormData4.prototype._lastBoundary = function() {
9328
- return "--" + this.getBoundary() + "--" + FormData4.LINE_BREAK;
9331
+ FormData3.prototype._lastBoundary = function() {
9332
+ return "--" + this.getBoundary() + "--" + FormData3.LINE_BREAK;
9329
9333
  };
9330
- FormData4.prototype.getHeaders = function(userHeaders) {
9334
+ FormData3.prototype.getHeaders = function(userHeaders) {
9331
9335
  var header;
9332
9336
  var formHeaders = {
9333
9337
  "content-type": "multipart/form-data; boundary=" + this.getBoundary()
@@ -9339,16 +9343,16 @@ var require_form_data = __commonJS({
9339
9343
  }
9340
9344
  return formHeaders;
9341
9345
  };
9342
- FormData4.prototype.setBoundary = function(boundary) {
9346
+ FormData3.prototype.setBoundary = function(boundary) {
9343
9347
  this._boundary = boundary;
9344
9348
  };
9345
- FormData4.prototype.getBoundary = function() {
9349
+ FormData3.prototype.getBoundary = function() {
9346
9350
  if (!this._boundary) {
9347
9351
  this._generateBoundary();
9348
9352
  }
9349
9353
  return this._boundary;
9350
9354
  };
9351
- FormData4.prototype.getBuffer = function() {
9355
+ FormData3.prototype.getBuffer = function() {
9352
9356
  var dataBuffer = new Buffer.alloc(0);
9353
9357
  var boundary = this.getBoundary();
9354
9358
  for (var i = 0, len = this._streams.length; i < len; i++) {
@@ -9359,20 +9363,20 @@ var require_form_data = __commonJS({
9359
9363
  dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
9360
9364
  }
9361
9365
  if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
9362
- dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData4.LINE_BREAK)]);
9366
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData3.LINE_BREAK)]);
9363
9367
  }
9364
9368
  }
9365
9369
  }
9366
9370
  return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
9367
9371
  };
9368
- FormData4.prototype._generateBoundary = function() {
9372
+ FormData3.prototype._generateBoundary = function() {
9369
9373
  var boundary = "--------------------------";
9370
9374
  for (var i = 0; i < 24; i++) {
9371
9375
  boundary += Math.floor(Math.random() * 10).toString(16);
9372
9376
  }
9373
9377
  this._boundary = boundary;
9374
9378
  };
9375
- FormData4.prototype.getLengthSync = function() {
9379
+ FormData3.prototype.getLengthSync = function() {
9376
9380
  var knownLength = this._overheadLength + this._valueLength;
9377
9381
  if (this._streams.length) {
9378
9382
  knownLength += this._lastBoundary().length;
@@ -9382,14 +9386,14 @@ var require_form_data = __commonJS({
9382
9386
  }
9383
9387
  return knownLength;
9384
9388
  };
9385
- FormData4.prototype.hasKnownLength = function() {
9389
+ FormData3.prototype.hasKnownLength = function() {
9386
9390
  var hasKnownLength = true;
9387
9391
  if (this._valuesToMeasure.length) {
9388
9392
  hasKnownLength = false;
9389
9393
  }
9390
9394
  return hasKnownLength;
9391
9395
  };
9392
- FormData4.prototype.getLength = function(cb) {
9396
+ FormData3.prototype.getLength = function(cb) {
9393
9397
  var knownLength = this._overheadLength + this._valueLength;
9394
9398
  if (this._streams.length) {
9395
9399
  knownLength += this._lastBoundary().length;
@@ -9409,7 +9413,7 @@ var require_form_data = __commonJS({
9409
9413
  cb(null, knownLength);
9410
9414
  });
9411
9415
  };
9412
- FormData4.prototype.submit = function(params, cb) {
9416
+ FormData3.prototype.submit = function(params, cb) {
9413
9417
  var request, options, defaults2 = { method: "post" };
9414
9418
  if (typeof params == "string") {
9415
9419
  params = parseUrl(params);
@@ -9454,14 +9458,14 @@ var require_form_data = __commonJS({
9454
9458
  }.bind(this));
9455
9459
  return request;
9456
9460
  };
9457
- FormData4.prototype._error = function(err) {
9461
+ FormData3.prototype._error = function(err) {
9458
9462
  if (!this.error) {
9459
9463
  this.error = err;
9460
9464
  this.pause();
9461
9465
  this.emit("error", err);
9462
9466
  }
9463
9467
  };
9464
- FormData4.prototype.toString = function() {
9468
+ FormData3.prototype.toString = function() {
9465
9469
  return "[object FormData]";
9466
9470
  };
9467
9471
  }
@@ -9483,7 +9487,7 @@ var require_proxy_from_env = __commonJS({
9483
9487
  var stringEndsWith = String.prototype.endsWith || function(s) {
9484
9488
  return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
9485
9489
  };
9486
- function getProxyForUrl2(url2) {
9490
+ function getProxyForUrl(url2) {
9487
9491
  var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
9488
9492
  var proto = parsedUrl.protocol;
9489
9493
  var hostname = parsedUrl.host;
@@ -9533,7 +9537,7 @@ var require_proxy_from_env = __commonJS({
9533
9537
  function getEnv(key) {
9534
9538
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
9535
9539
  }
9536
- exports.getProxyForUrl = getProxyForUrl2;
9540
+ exports.getProxyForUrl = getProxyForUrl;
9537
9541
  }
9538
9542
  });
9539
9543
 
@@ -10091,8 +10095,8 @@ var require_supports_color = __commonJS({
10091
10095
  }
10092
10096
  return min;
10093
10097
  }
10094
- function getSupportLevel(stream3) {
10095
- const level = supportsColor(stream3, stream3 && stream3.isTTY);
10098
+ function getSupportLevel(stream4) {
10099
+ const level = supportsColor(stream4, stream4 && stream4.isTTY);
10096
10100
  return translateLevel(level);
10097
10101
  }
10098
10102
  module.exports = {
@@ -10108,14 +10112,14 @@ var require_node = __commonJS({
10108
10112
  "../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module) {
10109
10113
  "use strict";
10110
10114
  var tty = __require("tty");
10111
- var util = __require("util");
10115
+ var util3 = __require("util");
10112
10116
  exports.init = init;
10113
10117
  exports.log = log;
10114
10118
  exports.formatArgs = formatArgs;
10115
10119
  exports.save = save;
10116
10120
  exports.load = load;
10117
10121
  exports.useColors = useColors;
10118
- exports.destroy = util.deprecate(
10122
+ exports.destroy = util3.deprecate(
10119
10123
  () => {
10120
10124
  },
10121
10125
  "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
@@ -10246,7 +10250,7 @@ var require_node = __commonJS({
10246
10250
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
10247
10251
  }
10248
10252
  function log(...args) {
10249
- return process.stderr.write(util.format(...args) + "\n");
10253
+ return process.stderr.write(util3.format(...args) + "\n");
10250
10254
  }
10251
10255
  function save(namespaces) {
10252
10256
  if (namespaces) {
@@ -10269,11 +10273,11 @@ var require_node = __commonJS({
10269
10273
  var { formatters } = module.exports;
10270
10274
  formatters.o = function(v) {
10271
10275
  this.inspectOpts.colors = this.useColors;
10272
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
10276
+ return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
10273
10277
  };
10274
10278
  formatters.O = function(v) {
10275
10279
  this.inspectOpts.colors = this.useColors;
10276
- return util.inspect(v, this.inspectOpts);
10280
+ return util3.inspect(v, this.inspectOpts);
10277
10281
  };
10278
10282
  }
10279
10283
  });
@@ -11238,8 +11242,153 @@ Object.defineProperty(Emittery, "listenerRemoved", {
11238
11242
  configurable: false
11239
11243
  });
11240
11244
 
11241
- // src/Authenticator.ts
11242
- import { Credentials } from "@dstny/scp-credentials";
11245
+ // ../credentials/dist/index.mjs
11246
+ function base64decode(str) {
11247
+ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
11248
+ let output = "";
11249
+ str = String(str).replace(/={1,10}$/, "");
11250
+ if (str.length % 4 === 1) {
11251
+ throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");
11252
+ }
11253
+ for (
11254
+ let bc = 0, bs, buffer, idx = 0;
11255
+ // tslint:disable-next-line:no-conditional-assignment
11256
+ buffer = str.charAt(idx++);
11257
+ // tslint:disable-next-line:no-bitwise
11258
+ ~buffer && // tslint:disable-next-line:no-conditional-assignment
11259
+ (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? (
11260
+ // tslint:disable-next-line:no-bitwise
11261
+ output += String.fromCharCode(255 & bs >> (-2 * bc & 6))
11262
+ ) : 0
11263
+ ) {
11264
+ buffer = chars.indexOf(buffer);
11265
+ }
11266
+ return output;
11267
+ }
11268
+ async function sha1(str) {
11269
+ if (typeof crypto === "object") {
11270
+ const hash = await crypto.subtle.digest("SHA-1", new TextEncoder().encode(str));
11271
+ return Array.from(new Uint8Array(hash)).map((v) => v.toString(16).padStart(2, "0")).join("");
11272
+ } else {
11273
+ const Crypto = await import("crypto");
11274
+ return Crypto.createHash("sha1").update(str).digest("hex");
11275
+ }
11276
+ }
11277
+ var STORE_CREDENTILAS_KEY = "sdk-auth-credential";
11278
+ var Credentials = class _Credentials {
11279
+ static async fromStorage(storage) {
11280
+ const str = await storage.getItem(STORE_CREDENTILAS_KEY);
11281
+ if (str == null || str == void 0) {
11282
+ throw new Error("No credentials found in storage.");
11283
+ }
11284
+ return _Credentials.fromJSON(str);
11285
+ }
11286
+ static async toStorage(storage, credentials) {
11287
+ await storage.setItem(STORE_CREDENTILAS_KEY, JSON.stringify(credentials));
11288
+ }
11289
+ static async clearFromStorage(storage) {
11290
+ await storage.deleteItem(STORE_CREDENTILAS_KEY);
11291
+ }
11292
+ static fromJSON(str) {
11293
+ const { access_token, refresh_token, expires_in } = JSON.parse(str);
11294
+ return new _Credentials(access_token, refresh_token, expires_in);
11295
+ }
11296
+ static onStorageUpdate(storage, callback) {
11297
+ return storage.on(STORE_CREDENTILAS_KEY, (credentials) => {
11298
+ if (typeof credentials === "string") {
11299
+ callback(_Credentials.fromJSON(credentials));
11300
+ }
11301
+ });
11302
+ }
11303
+ static equals(a, b) {
11304
+ if (!a && !b) {
11305
+ return true;
11306
+ }
11307
+ if (a && !b || b && !a) {
11308
+ return false;
11309
+ }
11310
+ return a?.access_token === b?.access_token && a?._refresh_token === b?.refresh_token && a?.expires_in === b?.expires_in;
11311
+ }
11312
+ /**
11313
+ * Used to access resources.
11314
+ */
11315
+ _access_token;
11316
+ /**
11317
+ * Used to obtain a new access token.
11318
+ */
11319
+ _refresh_token;
11320
+ /**
11321
+ * Number of seconds until the access token expires.
11322
+ * This value is calculated at the moment the access token is generated.
11323
+ */
11324
+ _expires_in;
11325
+ constructor(access_token, refresh_token, expires_in) {
11326
+ this._access_token = access_token;
11327
+ this._refresh_token = refresh_token;
11328
+ this._expires_in = expires_in;
11329
+ }
11330
+ /**
11331
+ * Lists the claims present in the access token.
11332
+ */
11333
+ get claims() {
11334
+ const fallback = {};
11335
+ if (typeof this._access_token != "string") {
11336
+ return fallback;
11337
+ }
11338
+ const [, b64payload] = this._access_token.split(".");
11339
+ const payload = base64decode(b64payload);
11340
+ if (!payload) {
11341
+ return fallback;
11342
+ }
11343
+ try {
11344
+ return JSON.parse(payload);
11345
+ } catch (err) {
11346
+ return {};
11347
+ }
11348
+ }
11349
+ get access_token() {
11350
+ return this._access_token;
11351
+ }
11352
+ get refresh_token() {
11353
+ return this._refresh_token;
11354
+ }
11355
+ get expires_in() {
11356
+ return this._expires_in;
11357
+ }
11358
+ get token_type() {
11359
+ return "Bearer";
11360
+ }
11361
+ get expires_at() {
11362
+ if (typeof this.claims?.exp === "number") {
11363
+ return new Date(this.claims?.exp * 1e3);
11364
+ }
11365
+ const expiryDate = /* @__PURE__ */ new Date();
11366
+ expiryDate.setSeconds(expiryDate.getSeconds() + this._expires_in);
11367
+ return expiryDate;
11368
+ }
11369
+ isExpired() {
11370
+ return this.expires_at && (/* @__PURE__ */ new Date()).getTime() > new Date(this.expires_at).getTime();
11371
+ }
11372
+ async getUepId() {
11373
+ const { sub, uep_id: rawUepId } = this.claims;
11374
+ if (!sub) {
11375
+ throw new Error("Missing 'sub' claim.");
11376
+ }
11377
+ if (rawUepId) {
11378
+ return rawUepId;
11379
+ }
11380
+ return await sha1(sub);
11381
+ }
11382
+ toJSON() {
11383
+ return {
11384
+ access_token: this._access_token,
11385
+ refresh_token: this._refresh_token,
11386
+ expires_in: this._expires_in,
11387
+ expires_at: this.expires_at,
11388
+ token_type: this.token_type
11389
+ };
11390
+ }
11391
+ };
11243
11392
 
11244
11393
  // src/utils/jwt.ts
11245
11394
  function decodeToken(token) {
@@ -11790,16 +11939,17 @@ var Authenticator = class extends Emittery {
11790
11939
  };
11791
11940
  var Authenticator_default = Authenticator;
11792
11941
 
11793
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/bind.js
11942
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/bind.js
11794
11943
  function bind(fn, thisArg) {
11795
11944
  return function wrap() {
11796
11945
  return fn.apply(thisArg, arguments);
11797
11946
  };
11798
11947
  }
11799
11948
 
11800
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/utils.js
11949
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/utils.js
11801
11950
  var { toString } = Object.prototype;
11802
11951
  var { getPrototypeOf } = Object;
11952
+ var { iterator: iterator2, toStringTag } = Symbol;
11803
11953
  var kindOf = ((cache) => (thing) => {
11804
11954
  const str = toString.call(thing);
11805
11955
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -11834,7 +11984,7 @@ var isPlainObject = (val) => {
11834
11984
  return false;
11835
11985
  }
11836
11986
  const prototype3 = getPrototypeOf(val);
11837
- return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
11987
+ return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator2 in val);
11838
11988
  };
11839
11989
  var isDate = kindOfTest("Date");
11840
11990
  var isFile = kindOfTest("File");
@@ -11842,10 +11992,12 @@ var isBlob = kindOfTest("Blob");
11842
11992
  var isFileList = kindOfTest("FileList");
11843
11993
  var isStream = (val) => isObject(val) && isFunction(val.pipe);
11844
11994
  var isFormData = (thing) => {
11845
- const pattern = "[object FormData]";
11846
- return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
11995
+ let kind;
11996
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
11997
+ kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
11847
11998
  };
11848
11999
  var isURLSearchParams = kindOfTest("URLSearchParams");
12000
+ var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
11849
12001
  var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
11850
12002
  function forEach(obj, fn, { allOwnKeys = false } = {}) {
11851
12003
  if (obj === null || typeof obj === "undefined") {
@@ -11883,7 +12035,11 @@ function findKey(obj, key) {
11883
12035
  }
11884
12036
  return null;
11885
12037
  }
11886
- var _global = typeof self === "undefined" ? typeof global === "undefined" ? void 0 : global : self;
12038
+ var _global = (() => {
12039
+ if (typeof globalThis !== "undefined")
12040
+ return globalThis;
12041
+ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
12042
+ })();
11887
12043
  var isContextDefined = (context) => !isUndefined(context) && context !== _global;
11888
12044
  function merge() {
11889
12045
  const { caseless } = isContextDefined(this) && this || {};
@@ -11980,10 +12136,10 @@ var isTypedArray = ((TypedArray) => {
11980
12136
  };
11981
12137
  })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
11982
12138
  var forEachEntry = (obj, fn) => {
11983
- const generator = obj && obj[Symbol.iterator];
11984
- const iterator2 = generator.call(obj);
12139
+ const generator = obj && obj[iterator2];
12140
+ const _iterator = generator.call(obj);
11985
12141
  let result;
11986
- while ((result = iterator2.next()) && !result.done) {
12142
+ while ((result = _iterator.next()) && !result.done) {
11987
12143
  const pair = result.value;
11988
12144
  fn.call(obj, pair[0], pair[1]);
11989
12145
  }
@@ -11999,7 +12155,7 @@ var matchAll = (regExp, str) => {
11999
12155
  var isHTMLForm = kindOfTest("HTMLFormElement");
12000
12156
  var toCamelCase = (str) => {
12001
12157
  return str.toLowerCase().replace(
12002
- /[_-\s]([a-z\d])(\w*)/g,
12158
+ /[-_\s]([a-z\d])(\w*)/g,
12003
12159
  function replacer(m, p1, p2) {
12004
12160
  return p1.toUpperCase() + p2;
12005
12161
  }
@@ -12011,8 +12167,9 @@ var reduceDescriptors = (obj, reducer) => {
12011
12167
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
12012
12168
  const reducedDescriptors = {};
12013
12169
  forEach(descriptors2, (descriptor, name) => {
12014
- if (reducer(descriptor, name, obj) !== false) {
12015
- reducedDescriptors[name] = descriptor;
12170
+ let ret;
12171
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
12172
+ reducedDescriptors[name] = ret || descriptor;
12016
12173
  }
12017
12174
  });
12018
12175
  Object.defineProperties(obj, reducedDescriptors);
@@ -12050,9 +12207,11 @@ var toObjectSet = (arrayOrString, delimiter) => {
12050
12207
  var noop = () => {
12051
12208
  };
12052
12209
  var toFiniteNumber = (value, defaultValue) => {
12053
- value = +value;
12054
- return Number.isFinite(value) ? value : defaultValue;
12210
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
12055
12211
  };
12212
+ function isSpecCompliantForm(thing) {
12213
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator2]);
12214
+ }
12056
12215
  var toJSONObject = (obj) => {
12057
12216
  const stack = new Array(10);
12058
12217
  const visit = (source, i) => {
@@ -12075,6 +12234,29 @@ var toJSONObject = (obj) => {
12075
12234
  };
12076
12235
  return visit(obj, 0);
12077
12236
  };
12237
+ var isAsyncFn = kindOfTest("AsyncFunction");
12238
+ var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
12239
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
12240
+ if (setImmediateSupported) {
12241
+ return setImmediate;
12242
+ }
12243
+ return postMessageSupported ? ((token, callbacks) => {
12244
+ _global.addEventListener("message", ({ source, data }) => {
12245
+ if (source === _global && data === token) {
12246
+ callbacks.length && callbacks.shift()();
12247
+ }
12248
+ }, false);
12249
+ return (cb) => {
12250
+ callbacks.push(cb);
12251
+ _global.postMessage(token, "*");
12252
+ };
12253
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
12254
+ })(
12255
+ typeof setImmediate === "function",
12256
+ isFunction(_global.postMessage)
12257
+ );
12258
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
12259
+ var isIterable = (thing) => thing != null && isFunction(thing[iterator2]);
12078
12260
  var utils_default = {
12079
12261
  isArray,
12080
12262
  isArrayBuffer,
@@ -12086,6 +12268,10 @@ var utils_default = {
12086
12268
  isBoolean,
12087
12269
  isObject,
12088
12270
  isPlainObject,
12271
+ isReadableStream,
12272
+ isRequest,
12273
+ isResponse,
12274
+ isHeaders,
12089
12275
  isUndefined,
12090
12276
  isDate,
12091
12277
  isFile,
@@ -12122,10 +12308,16 @@ var utils_default = {
12122
12308
  findKey,
12123
12309
  global: _global,
12124
12310
  isContextDefined,
12125
- toJSONObject
12311
+ isSpecCompliantForm,
12312
+ toJSONObject,
12313
+ isAsyncFn,
12314
+ isThenable,
12315
+ setImmediate: _setImmediate,
12316
+ asap,
12317
+ isIterable
12126
12318
  };
12127
12319
 
12128
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/AxiosError.js
12320
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/AxiosError.js
12129
12321
  function AxiosError(message, code, config, request, response) {
12130
12322
  Error.call(this);
12131
12323
  if (Error.captureStackTrace) {
@@ -12138,7 +12330,10 @@ function AxiosError(message, code, config, request, response) {
12138
12330
  code && (this.code = code);
12139
12331
  config && (this.config = config);
12140
12332
  request && (this.request = request);
12141
- response && (this.response = response);
12333
+ if (response) {
12334
+ this.response = response;
12335
+ this.status = response.status ? response.status : null;
12336
+ }
12142
12337
  }
12143
12338
  utils_default.inherits(AxiosError, Error, {
12144
12339
  toJSON: function toJSON() {
@@ -12157,7 +12352,7 @@ utils_default.inherits(AxiosError, Error, {
12157
12352
  // Axios
12158
12353
  config: utils_default.toJSONObject(this.config),
12159
12354
  code: this.code,
12160
- status: this.response && this.response.status ? this.response.status : null
12355
+ status: this.status
12161
12356
  };
12162
12357
  }
12163
12358
  });
@@ -12197,11 +12392,11 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
12197
12392
  };
12198
12393
  var AxiosError_default = AxiosError;
12199
12394
 
12200
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/env/classes/FormData.js
12395
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/platform/node/classes/FormData.js
12201
12396
  var import_form_data = __toESM(require_form_data(), 1);
12202
12397
  var FormData_default = import_form_data.default;
12203
12398
 
12204
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/toFormData.js
12399
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/toFormData.js
12205
12400
  function isVisitable(thing) {
12206
12401
  return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
12207
12402
  }
@@ -12222,9 +12417,6 @@ function isFlatArray(arr) {
12222
12417
  var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
12223
12418
  return /^is[A-Z]/.test(prop);
12224
12419
  });
12225
- function isSpecCompliant(thing) {
12226
- return thing && utils_default.isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator];
12227
- }
12228
12420
  function toFormData(obj, formData, options) {
12229
12421
  if (!utils_default.isObject(obj)) {
12230
12422
  throw new TypeError("target must be an object");
@@ -12242,7 +12434,7 @@ function toFormData(obj, formData, options) {
12242
12434
  const dots = options.dots;
12243
12435
  const indexes = options.indexes;
12244
12436
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
12245
- const useBlob = _Blob && isSpecCompliant(formData);
12437
+ const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
12246
12438
  if (!utils_default.isFunction(visitor)) {
12247
12439
  throw new TypeError("visitor must be a function");
12248
12440
  }
@@ -12266,7 +12458,7 @@ function toFormData(obj, formData, options) {
12266
12458
  if (utils_default.endsWith(key, "{}")) {
12267
12459
  key = metaTokens ? key : key.slice(0, -2);
12268
12460
  value = JSON.stringify(value);
12269
- } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]") && (arr = utils_default.toArray(value)))) {
12461
+ } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
12270
12462
  key = removeBrackets(key);
12271
12463
  arr.forEach(function each(el, index) {
12272
12464
  !(utils_default.isUndefined(el) || el === null) && formData.append(
@@ -12319,7 +12511,7 @@ function toFormData(obj, formData, options) {
12319
12511
  }
12320
12512
  var toFormData_default = toFormData;
12321
12513
 
12322
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
12514
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
12323
12515
  function encode(str) {
12324
12516
  const charMap = {
12325
12517
  "!": "%21",
@@ -12352,7 +12544,7 @@ prototype2.toString = function toString2(encoder) {
12352
12544
  };
12353
12545
  var AxiosURLSearchParams_default = AxiosURLSearchParams;
12354
12546
 
12355
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/buildURL.js
12547
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/buildURL.js
12356
12548
  function encode2(val) {
12357
12549
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
12358
12550
  }
@@ -12361,6 +12553,11 @@ function buildURL(url2, params, options) {
12361
12553
  return url2;
12362
12554
  }
12363
12555
  const _encode = options && options.encode || encode2;
12556
+ if (utils_default.isFunction(options)) {
12557
+ options = {
12558
+ serialize: options
12559
+ };
12560
+ }
12364
12561
  const serializeFn = options && options.serialize;
12365
12562
  let serializedParams;
12366
12563
  if (serializeFn) {
@@ -12378,7 +12575,7 @@ function buildURL(url2, params, options) {
12378
12575
  return url2;
12379
12576
  }
12380
12577
 
12381
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/InterceptorManager.js
12578
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/InterceptorManager.js
12382
12579
  var InterceptorManager = class {
12383
12580
  constructor() {
12384
12581
  this.handlers = [];
@@ -12442,37 +12639,79 @@ var InterceptorManager = class {
12442
12639
  };
12443
12640
  var InterceptorManager_default = InterceptorManager;
12444
12641
 
12445
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/defaults/transitional.js
12642
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/defaults/transitional.js
12446
12643
  var transitional_default = {
12447
12644
  silentJSONParsing: true,
12448
12645
  forcedJSONParsing: true,
12449
12646
  clarifyTimeoutError: false
12450
12647
  };
12451
12648
 
12452
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
12649
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/platform/node/index.js
12650
+ import crypto2 from "crypto";
12651
+
12652
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
12453
12653
  import url from "url";
12454
12654
  var URLSearchParams_default = url.URLSearchParams;
12455
12655
 
12456
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/platform/node/classes/FormData.js
12457
- var import_form_data2 = __toESM(require_form_data(), 1);
12458
- var FormData_default2 = import_form_data2.default;
12459
-
12460
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/platform/node/index.js
12656
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/platform/node/index.js
12657
+ var ALPHA = "abcdefghijklmnopqrstuvwxyz";
12658
+ var DIGIT = "0123456789";
12659
+ var ALPHABET = {
12660
+ DIGIT,
12661
+ ALPHA,
12662
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
12663
+ };
12664
+ var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
12665
+ let str = "";
12666
+ const { length } = alphabet;
12667
+ const randomValues = new Uint32Array(size);
12668
+ crypto2.randomFillSync(randomValues);
12669
+ for (let i = 0; i < size; i++) {
12670
+ str += alphabet[randomValues[i] % length];
12671
+ }
12672
+ return str;
12673
+ };
12461
12674
  var node_default = {
12462
12675
  isNode: true,
12463
12676
  classes: {
12464
12677
  URLSearchParams: URLSearchParams_default,
12465
- FormData: FormData_default2,
12678
+ FormData: FormData_default,
12466
12679
  Blob: typeof Blob !== "undefined" && Blob || null
12467
12680
  },
12681
+ ALPHABET,
12682
+ generateString,
12468
12683
  protocols: ["http", "https", "file", "data"]
12469
12684
  };
12470
12685
 
12471
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/toURLEncodedForm.js
12686
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/platform/common/utils.js
12687
+ var utils_exports = {};
12688
+ __export(utils_exports, {
12689
+ hasBrowserEnv: () => hasBrowserEnv,
12690
+ hasStandardBrowserEnv: () => hasStandardBrowserEnv,
12691
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
12692
+ navigator: () => _navigator,
12693
+ origin: () => origin
12694
+ });
12695
+ var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
12696
+ var _navigator = typeof navigator === "object" && navigator || void 0;
12697
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
12698
+ var hasStandardBrowserWebWorkerEnv = (() => {
12699
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
12700
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
12701
+ })();
12702
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
12703
+
12704
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/platform/index.js
12705
+ var platform_default = {
12706
+ ...utils_exports,
12707
+ ...node_default
12708
+ };
12709
+
12710
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
12472
12711
  function toURLEncodedForm(data, options) {
12473
- return toFormData_default(data, new node_default.classes.URLSearchParams(), Object.assign({
12712
+ return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({
12474
12713
  visitor: function(value, key, path, helpers) {
12475
- if (node_default.isNode && utils_default.isBuffer(value)) {
12714
+ if (platform_default.isNode && utils_default.isBuffer(value)) {
12476
12715
  this.append(key, value.toString("base64"));
12477
12716
  return false;
12478
12717
  }
@@ -12481,7 +12720,7 @@ function toURLEncodedForm(data, options) {
12481
12720
  }, options));
12482
12721
  }
12483
12722
 
12484
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/formDataToJSON.js
12723
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/formDataToJSON.js
12485
12724
  function parsePropPath(name) {
12486
12725
  return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
12487
12726
  return match[0] === "[]" ? "" : match[1] || match[0];
@@ -12502,6 +12741,8 @@ function arrayToObject(arr) {
12502
12741
  function formDataToJSON(formData) {
12503
12742
  function buildPath(path, value, target, index) {
12504
12743
  let name = path[index++];
12744
+ if (name === "__proto__")
12745
+ return true;
12505
12746
  const isNumericKey = Number.isFinite(+name);
12506
12747
  const isLast = index >= path.length;
12507
12748
  name = !name && utils_default.isArray(target) ? target.length : name;
@@ -12533,10 +12774,7 @@ function formDataToJSON(formData) {
12533
12774
  }
12534
12775
  var formDataToJSON_default = formDataToJSON;
12535
12776
 
12536
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/defaults/index.js
12537
- var DEFAULT_CONTENT_TYPE = {
12538
- "Content-Type": void 0
12539
- };
12777
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/defaults/index.js
12540
12778
  function stringifySafely(rawValue, parser, encoder) {
12541
12779
  if (utils_default.isString(rawValue)) {
12542
12780
  try {
@@ -12552,7 +12790,7 @@ function stringifySafely(rawValue, parser, encoder) {
12552
12790
  }
12553
12791
  var defaults = {
12554
12792
  transitional: transitional_default,
12555
- adapter: ["xhr", "http"],
12793
+ adapter: ["xhr", "http", "fetch"],
12556
12794
  transformRequest: [function transformRequest(data, headers) {
12557
12795
  const contentType = headers.getContentType() || "";
12558
12796
  const hasJSONContentType = contentType.indexOf("application/json") > -1;
@@ -12562,12 +12800,9 @@ var defaults = {
12562
12800
  }
12563
12801
  const isFormData2 = utils_default.isFormData(data);
12564
12802
  if (isFormData2) {
12565
- if (!hasJSONContentType) {
12566
- return data;
12567
- }
12568
12803
  return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
12569
12804
  }
12570
- if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
12805
+ if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
12571
12806
  return data;
12572
12807
  }
12573
12808
  if (utils_default.isArrayBufferView(data)) {
@@ -12601,6 +12836,9 @@ var defaults = {
12601
12836
  const transitional2 = this.transitional || defaults.transitional;
12602
12837
  const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
12603
12838
  const JSONRequested = this.responseType === "json";
12839
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
12840
+ return data;
12841
+ }
12604
12842
  if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
12605
12843
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
12606
12844
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
@@ -12627,27 +12865,25 @@ var defaults = {
12627
12865
  maxContentLength: -1,
12628
12866
  maxBodyLength: -1,
12629
12867
  env: {
12630
- FormData: node_default.classes.FormData,
12631
- Blob: node_default.classes.Blob
12868
+ FormData: platform_default.classes.FormData,
12869
+ Blob: platform_default.classes.Blob
12632
12870
  },
12633
12871
  validateStatus: function validateStatus(status) {
12634
12872
  return status >= 200 && status < 300;
12635
12873
  },
12636
12874
  headers: {
12637
12875
  common: {
12638
- "Accept": "application/json, text/plain, */*"
12876
+ "Accept": "application/json, text/plain, */*",
12877
+ "Content-Type": void 0
12639
12878
  }
12640
12879
  }
12641
12880
  };
12642
- utils_default.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
12881
+ utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
12643
12882
  defaults.headers[method] = {};
12644
12883
  });
12645
- utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
12646
- defaults.headers[method] = utils_default.merge(DEFAULT_CONTENT_TYPE);
12647
- });
12648
12884
  var defaults_default = defaults;
12649
12885
 
12650
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/parseHeaders.js
12886
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/parseHeaders.js
12651
12887
  var ignoreDuplicateOf = utils_default.toObjectSet([
12652
12888
  "age",
12653
12889
  "authorization",
@@ -12692,7 +12928,7 @@ var parseHeaders_default = (rawHeaders) => {
12692
12928
  return parsed;
12693
12929
  };
12694
12930
 
12695
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/AxiosHeaders.js
12931
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/AxiosHeaders.js
12696
12932
  var $internals = Symbol("internals");
12697
12933
  function normalizeHeader(header) {
12698
12934
  return header && String(header).trim().toLowerCase();
@@ -12712,13 +12948,14 @@ function parseTokens(str) {
12712
12948
  }
12713
12949
  return tokens;
12714
12950
  }
12715
- function isValidHeaderName(str) {
12716
- return /^[-_a-zA-Z]+$/.test(str.trim());
12717
- }
12718
- function matchHeaderValue(context, value, header, filter2) {
12951
+ var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
12952
+ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
12719
12953
  if (utils_default.isFunction(filter2)) {
12720
12954
  return filter2.call(this, value, header);
12721
12955
  }
12956
+ if (isHeaderNameFilter) {
12957
+ value = header;
12958
+ }
12722
12959
  if (!utils_default.isString(value))
12723
12960
  return;
12724
12961
  if (utils_default.isString(filter2)) {
@@ -12765,6 +13002,15 @@ var AxiosHeaders = class {
12765
13002
  setHeaders(header, valueOrRewrite);
12766
13003
  } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
12767
13004
  setHeaders(parseHeaders_default(header), valueOrRewrite);
13005
+ } else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
13006
+ let obj = {}, dest, key;
13007
+ for (const entry of header) {
13008
+ if (!utils_default.isArray(entry)) {
13009
+ throw TypeError("Object iterator must return a key-value pair");
13010
+ }
13011
+ obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
13012
+ }
13013
+ setHeaders(obj, valueOrRewrite);
12768
13014
  } else {
12769
13015
  header != null && setHeader(valueOrRewrite, header, rewrite);
12770
13016
  }
@@ -12796,7 +13042,7 @@ var AxiosHeaders = class {
12796
13042
  header = normalizeHeader(header);
12797
13043
  if (header) {
12798
13044
  const key = utils_default.findKey(this, header);
12799
- return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
13045
+ return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
12800
13046
  }
12801
13047
  return false;
12802
13048
  }
@@ -12820,8 +13066,18 @@ var AxiosHeaders = class {
12820
13066
  }
12821
13067
  return deleted;
12822
13068
  }
12823
- clear() {
12824
- return Object.keys(this).forEach(this.delete.bind(this));
13069
+ clear(matcher) {
13070
+ const keys = Object.keys(this);
13071
+ let i = keys.length;
13072
+ let deleted = false;
13073
+ while (i--) {
13074
+ const key = keys[i];
13075
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
13076
+ delete this[key];
13077
+ deleted = true;
13078
+ }
13079
+ }
13080
+ return deleted;
12825
13081
  }
12826
13082
  normalize(format) {
12827
13083
  const self2 = this;
@@ -12858,6 +13114,9 @@ var AxiosHeaders = class {
12858
13114
  toString() {
12859
13115
  return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
12860
13116
  }
13117
+ getSetCookie() {
13118
+ return this.get("set-cookie") || [];
13119
+ }
12861
13120
  get [Symbol.toStringTag]() {
12862
13121
  return "AxiosHeaders";
12863
13122
  }
@@ -12886,12 +13145,20 @@ var AxiosHeaders = class {
12886
13145
  return this;
12887
13146
  }
12888
13147
  };
12889
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent"]);
12890
- utils_default.freezeMethods(AxiosHeaders.prototype);
13148
+ AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
13149
+ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
13150
+ let mapped = key[0].toUpperCase() + key.slice(1);
13151
+ return {
13152
+ get: () => value,
13153
+ set(headerValue) {
13154
+ this[mapped] = headerValue;
13155
+ }
13156
+ };
13157
+ });
12891
13158
  utils_default.freezeMethods(AxiosHeaders);
12892
13159
  var AxiosHeaders_default = AxiosHeaders;
12893
13160
 
12894
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/transformData.js
13161
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/transformData.js
12895
13162
  function transformData(fns, response) {
12896
13163
  const config = this || defaults_default;
12897
13164
  const context = response || config;
@@ -12904,12 +13171,12 @@ function transformData(fns, response) {
12904
13171
  return data;
12905
13172
  }
12906
13173
 
12907
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/cancel/isCancel.js
13174
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/cancel/isCancel.js
12908
13175
  function isCancel(value) {
12909
13176
  return !!(value && value.__CANCEL__);
12910
13177
  }
12911
13178
 
12912
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/cancel/CanceledError.js
13179
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/cancel/CanceledError.js
12913
13180
  function CanceledError(message, config, request) {
12914
13181
  AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
12915
13182
  this.name = "CanceledError";
@@ -12919,7 +13186,7 @@ utils_default.inherits(CanceledError, AxiosError_default, {
12919
13186
  });
12920
13187
  var CanceledError_default = CanceledError;
12921
13188
 
12922
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/settle.js
13189
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/settle.js
12923
13190
  function settle(resolve, reject, response) {
12924
13191
  const validateStatus2 = response.config.validateStatus;
12925
13192
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
@@ -12935,44 +13202,46 @@ function settle(resolve, reject, response) {
12935
13202
  }
12936
13203
  }
12937
13204
 
12938
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/isAbsoluteURL.js
13205
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/isAbsoluteURL.js
12939
13206
  function isAbsoluteURL(url2) {
12940
13207
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
12941
13208
  }
12942
13209
 
12943
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/combineURLs.js
13210
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/combineURLs.js
12944
13211
  function combineURLs(baseURL, relativeURL) {
12945
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
13212
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
12946
13213
  }
12947
13214
 
12948
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/buildFullPath.js
12949
- function buildFullPath(baseURL, requestedURL) {
12950
- if (baseURL && !isAbsoluteURL(requestedURL)) {
13215
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/buildFullPath.js
13216
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
13217
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
13218
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
12951
13219
  return combineURLs(baseURL, requestedURL);
12952
13220
  }
12953
13221
  return requestedURL;
12954
13222
  }
12955
13223
 
12956
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/adapters/http.js
13224
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/http.js
12957
13225
  var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
12958
13226
  var import_follow_redirects = __toESM(require_follow_redirects(), 1);
12959
13227
  import http from "http";
12960
13228
  import https from "https";
13229
+ import util2 from "util";
12961
13230
  import zlib from "zlib";
12962
13231
 
12963
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/env/data.js
12964
- var VERSION = "1.2.1";
13232
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/env/data.js
13233
+ var VERSION = "1.9.0";
12965
13234
 
12966
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/parseProtocol.js
13235
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/parseProtocol.js
12967
13236
  function parseProtocol(url2) {
12968
13237
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
12969
13238
  return match && match[1] || "";
12970
13239
  }
12971
13240
 
12972
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/fromDataURI.js
13241
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/fromDataURI.js
12973
13242
  var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
12974
13243
  function fromDataURI(uri, asBlob, options) {
12975
- const _Blob = options && options.Blob || node_default.classes.Blob;
13244
+ const _Blob = options && options.Blob || platform_default.classes.Blob;
12976
13245
  const protocol = parseProtocol(uri);
12977
13246
  if (asBlob === void 0 && _Blob) {
12978
13247
  asBlob = true;
@@ -12998,75 +13267,11 @@ function fromDataURI(uri, asBlob, options) {
12998
13267
  throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
12999
13268
  }
13000
13269
 
13001
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/adapters/http.js
13002
- import stream2 from "stream";
13270
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/http.js
13271
+ import stream3 from "stream";
13003
13272
 
13004
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/AxiosTransformStream.js
13273
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/AxiosTransformStream.js
13005
13274
  import stream from "stream";
13006
-
13007
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/throttle.js
13008
- function throttle(fn, freq) {
13009
- let timestamp = 0;
13010
- const threshold = 1e3 / freq;
13011
- let timer = null;
13012
- return function throttled(force, args) {
13013
- const now = Date.now();
13014
- if (force || now - timestamp > threshold) {
13015
- if (timer) {
13016
- clearTimeout(timer);
13017
- timer = null;
13018
- }
13019
- timestamp = now;
13020
- return fn.apply(null, args);
13021
- }
13022
- if (!timer) {
13023
- timer = setTimeout(() => {
13024
- timer = null;
13025
- timestamp = Date.now();
13026
- return fn.apply(null, args);
13027
- }, threshold - (now - timestamp));
13028
- }
13029
- };
13030
- }
13031
- var throttle_default = throttle;
13032
-
13033
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/speedometer.js
13034
- function speedometer(samplesCount, min) {
13035
- samplesCount = samplesCount || 10;
13036
- const bytes = new Array(samplesCount);
13037
- const timestamps = new Array(samplesCount);
13038
- let head = 0;
13039
- let tail = 0;
13040
- let firstSampleTS;
13041
- min = min !== void 0 ? min : 1e3;
13042
- return function push(chunkLength) {
13043
- const now = Date.now();
13044
- const startedAt = timestamps[tail];
13045
- if (!firstSampleTS) {
13046
- firstSampleTS = now;
13047
- }
13048
- bytes[head] = chunkLength;
13049
- timestamps[head] = now;
13050
- let i = tail;
13051
- let bytesCount = 0;
13052
- while (i !== head) {
13053
- bytesCount += bytes[i++];
13054
- i = i % samplesCount;
13055
- }
13056
- head = (head + 1) % samplesCount;
13057
- if (head === tail) {
13058
- tail = (tail + 1) % samplesCount;
13059
- }
13060
- if (now - firstSampleTS < min) {
13061
- return;
13062
- }
13063
- const passed = startedAt && now - startedAt;
13064
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
13065
- };
13066
- }
13067
- var speedometer_default = speedometer;
13068
-
13069
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/AxiosTransformStream.js
13070
13275
  var kInternals = Symbol("internals");
13071
13276
  var AxiosTransformStream = class extends stream.Transform {
13072
13277
  constructor(options) {
@@ -13083,11 +13288,8 @@ var AxiosTransformStream = class extends stream.Transform {
13083
13288
  super({
13084
13289
  readableHighWaterMark: options.chunkSize
13085
13290
  });
13086
- const self2 = this;
13087
13291
  const internals = this[kInternals] = {
13088
- length: options.length,
13089
13292
  timeWindow: options.timeWindow,
13090
- ticksRate: options.ticksRate,
13091
13293
  chunkSize: options.chunkSize,
13092
13294
  maxRate: options.maxRate,
13093
13295
  minChunkSize: options.minChunkSize,
@@ -13098,7 +13300,6 @@ var AxiosTransformStream = class extends stream.Transform {
13098
13300
  bytes: 0,
13099
13301
  onReadCallback: null
13100
13302
  };
13101
- const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
13102
13303
  this.on("newListener", (event) => {
13103
13304
  if (event === "progress") {
13104
13305
  if (!internals.isCaptured) {
@@ -13106,31 +13307,6 @@ var AxiosTransformStream = class extends stream.Transform {
13106
13307
  }
13107
13308
  }
13108
13309
  });
13109
- let bytesNotified = 0;
13110
- internals.updateProgress = throttle_default(function throttledHandler() {
13111
- const totalBytes = internals.length;
13112
- const bytesTransferred = internals.bytesSeen;
13113
- const progressBytes = bytesTransferred - bytesNotified;
13114
- if (!progressBytes || self2.destroyed)
13115
- return;
13116
- const rate = _speedometer(progressBytes);
13117
- bytesNotified = bytesTransferred;
13118
- process.nextTick(() => {
13119
- self2.emit("progress", {
13120
- "loaded": bytesTransferred,
13121
- "total": totalBytes,
13122
- "progress": totalBytes ? bytesTransferred / totalBytes : void 0,
13123
- "bytes": progressBytes,
13124
- "rate": rate ? rate : void 0,
13125
- "estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0
13126
- });
13127
- });
13128
- }, internals.ticksRate);
13129
- const onFinish = () => {
13130
- internals.updateProgress(true);
13131
- };
13132
- this.once("end", onFinish);
13133
- this.once("error", onFinish);
13134
13310
  }
13135
13311
  _read(size) {
13136
13312
  const internals = this[kInternals];
@@ -13140,7 +13316,6 @@ var AxiosTransformStream = class extends stream.Transform {
13140
13316
  return super._read(size);
13141
13317
  }
13142
13318
  _transform(chunk, encoding, callback) {
13143
- const self2 = this;
13144
13319
  const internals = this[kInternals];
13145
13320
  const maxRate = internals.maxRate;
13146
13321
  const readableHighWaterMark = this.readableHighWaterMark;
@@ -13148,14 +13323,12 @@ var AxiosTransformStream = class extends stream.Transform {
13148
13323
  const divider = 1e3 / timeWindow;
13149
13324
  const bytesThreshold = maxRate / divider;
13150
13325
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
13151
- function pushChunk(_chunk, _callback) {
13326
+ const pushChunk = (_chunk, _callback) => {
13152
13327
  const bytes = Buffer.byteLength(_chunk);
13153
13328
  internals.bytesSeen += bytes;
13154
13329
  internals.bytes += bytes;
13155
- if (internals.isCaptured) {
13156
- internals.updateProgress();
13157
- }
13158
- if (self2.push(_chunk)) {
13330
+ internals.isCaptured && this.emit("progress", internals.bytesSeen);
13331
+ if (this.push(_chunk)) {
13159
13332
  process.nextTick(_callback);
13160
13333
  } else {
13161
13334
  internals.onReadCallback = () => {
@@ -13163,7 +13336,7 @@ var AxiosTransformStream = class extends stream.Transform {
13163
13336
  process.nextTick(_callback);
13164
13337
  };
13165
13338
  }
13166
- }
13339
+ };
13167
13340
  const transformChunk = (_chunk, _callback) => {
13168
13341
  const chunkSize = Buffer.byteLength(_chunk);
13169
13342
  let chunkRemainder = null;
@@ -13209,108 +13382,384 @@ var AxiosTransformStream = class extends stream.Transform {
13209
13382
  }
13210
13383
  });
13211
13384
  }
13212
- setLength(length) {
13213
- this[kInternals].length = +length;
13214
- return this;
13215
- }
13216
13385
  };
13217
13386
  var AxiosTransformStream_default = AxiosTransformStream;
13218
13387
 
13219
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/adapters/http.js
13220
- import EventEmitter from "events";
13221
- var zlibOptions = {
13222
- flush: zlib.constants.Z_SYNC_FLUSH,
13223
- finishFlush: zlib.constants.Z_SYNC_FLUSH
13388
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/http.js
13389
+ import { EventEmitter } from "events";
13390
+
13391
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/formDataToStream.js
13392
+ import util from "util";
13393
+ import { Readable } from "stream";
13394
+
13395
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/readBlob.js
13396
+ var { asyncIterator } = Symbol;
13397
+ var readBlob = async function* (blob) {
13398
+ if (blob.stream) {
13399
+ yield* blob.stream();
13400
+ } else if (blob.arrayBuffer) {
13401
+ yield await blob.arrayBuffer();
13402
+ } else if (blob[asyncIterator]) {
13403
+ yield* blob[asyncIterator]();
13404
+ } else {
13405
+ yield blob;
13406
+ }
13224
13407
  };
13225
- var isBrotliSupported = utils_default.isFunction(zlib.createBrotliDecompress);
13226
- var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
13227
- var isHttps = /https:?/;
13228
- var supportedProtocols = node_default.protocols.map((protocol) => {
13229
- return protocol + ":";
13230
- });
13231
- function dispatchBeforeRedirect(options) {
13232
- if (options.beforeRedirects.proxy) {
13233
- options.beforeRedirects.proxy(options);
13408
+ var readBlob_default = readBlob;
13409
+
13410
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/formDataToStream.js
13411
+ var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
13412
+ var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.TextEncoder();
13413
+ var CRLF = "\r\n";
13414
+ var CRLF_BYTES = textEncoder.encode(CRLF);
13415
+ var CRLF_BYTES_COUNT = 2;
13416
+ var FormDataPart = class {
13417
+ constructor(name, value) {
13418
+ const { escapeName } = this.constructor;
13419
+ const isStringValue = utils_default.isString(value);
13420
+ let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
13421
+ if (isStringValue) {
13422
+ value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
13423
+ } else {
13424
+ headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
13425
+ }
13426
+ this.headers = textEncoder.encode(headers + CRLF);
13427
+ this.contentLength = isStringValue ? value.byteLength : value.size;
13428
+ this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
13429
+ this.name = name;
13430
+ this.value = value;
13431
+ }
13432
+ async *encode() {
13433
+ yield this.headers;
13434
+ const { value } = this;
13435
+ if (utils_default.isTypedArray(value)) {
13436
+ yield value;
13437
+ } else {
13438
+ yield* readBlob_default(value);
13439
+ }
13440
+ yield CRLF_BYTES;
13234
13441
  }
13235
- if (options.beforeRedirects.config) {
13236
- options.beforeRedirects.config(options);
13442
+ static escapeName(name) {
13443
+ return String(name).replace(/[\r\n"]/g, (match) => ({
13444
+ "\r": "%0D",
13445
+ "\n": "%0A",
13446
+ '"': "%22"
13447
+ })[match]);
13237
13448
  }
13238
- }
13239
- function setProxy(options, configProxy, location2) {
13240
- let proxy = configProxy;
13241
- if (!proxy && proxy !== false) {
13242
- const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(location2);
13243
- if (proxyUrl) {
13244
- proxy = new URL(proxyUrl);
13245
- }
13449
+ };
13450
+ var formDataToStream = (form, headersHandler, options) => {
13451
+ const {
13452
+ tag = "form-data-boundary",
13453
+ size = 25,
13454
+ boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET)
13455
+ } = options || {};
13456
+ if (!utils_default.isFormData(form)) {
13457
+ throw TypeError("FormData instance required");
13458
+ }
13459
+ if (boundary.length < 1 || boundary.length > 70) {
13460
+ throw Error("boundary must be 10-70 characters long");
13461
+ }
13462
+ const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
13463
+ const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
13464
+ let contentLength = footerBytes.byteLength;
13465
+ const parts = Array.from(form.entries()).map(([name, value]) => {
13466
+ const part = new FormDataPart(name, value);
13467
+ contentLength += part.size;
13468
+ return part;
13469
+ });
13470
+ contentLength += boundaryBytes.byteLength * parts.length;
13471
+ contentLength = utils_default.toFiniteNumber(contentLength);
13472
+ const computedHeaders = {
13473
+ "Content-Type": `multipart/form-data; boundary=${boundary}`
13474
+ };
13475
+ if (Number.isFinite(contentLength)) {
13476
+ computedHeaders["Content-Length"] = contentLength;
13246
13477
  }
13247
- if (proxy) {
13248
- if (proxy.username) {
13249
- proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
13250
- }
13251
- if (proxy.auth) {
13252
- if (proxy.auth.username || proxy.auth.password) {
13253
- proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
13254
- }
13255
- const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
13256
- options.headers["Proxy-Authorization"] = "Basic " + base64;
13257
- }
13258
- options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
13259
- const proxyHost = proxy.hostname || proxy.host;
13260
- options.hostname = proxyHost;
13261
- options.host = proxyHost;
13262
- options.port = proxy.port;
13263
- options.path = location2;
13264
- if (proxy.protocol) {
13265
- options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
13478
+ headersHandler && headersHandler(computedHeaders);
13479
+ return Readable.from(async function* () {
13480
+ for (const part of parts) {
13481
+ yield boundaryBytes;
13482
+ yield* part.encode();
13266
13483
  }
13484
+ yield footerBytes;
13485
+ }());
13486
+ };
13487
+ var formDataToStream_default = formDataToStream;
13488
+
13489
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
13490
+ import stream2 from "stream";
13491
+ var ZlibHeaderTransformStream = class extends stream2.Transform {
13492
+ __transform(chunk, encoding, callback) {
13493
+ this.push(chunk);
13494
+ callback();
13267
13495
  }
13268
- options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
13269
- setProxy(redirectOptions, configProxy, redirectOptions.href);
13270
- };
13271
- }
13272
- var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
13273
- var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13274
- return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
13275
- let data = config.data;
13276
- const responseType = config.responseType;
13277
- const responseEncoding = config.responseEncoding;
13278
- const method = config.method.toUpperCase();
13279
- let isFinished;
13280
- let isDone;
13281
- let rejected = false;
13282
- let req;
13283
- const emitter = new EventEmitter();
13284
- function onFinished() {
13285
- if (isFinished)
13286
- return;
13287
- isFinished = true;
13288
- if (config.cancelToken) {
13289
- config.cancelToken.unsubscribe(abort);
13290
- }
13291
- if (config.signal) {
13292
- config.signal.removeEventListener("abort", abort);
13496
+ _transform(chunk, encoding, callback) {
13497
+ if (chunk.length !== 0) {
13498
+ this._transform = this.__transform;
13499
+ if (chunk[0] !== 120) {
13500
+ const header = Buffer.alloc(2);
13501
+ header[0] = 120;
13502
+ header[1] = 156;
13503
+ this.push(header, encoding);
13293
13504
  }
13294
- emitter.removeAllListeners();
13295
13505
  }
13296
- function done(value, isRejected) {
13297
- if (isDone)
13298
- return;
13299
- isDone = true;
13300
- if (isRejected) {
13301
- rejected = true;
13302
- onFinished();
13506
+ this.__transform(chunk, encoding, callback);
13507
+ }
13508
+ };
13509
+ var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
13510
+
13511
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/callbackify.js
13512
+ var callbackify = (fn, reducer) => {
13513
+ return utils_default.isAsyncFn(fn) ? function(...args) {
13514
+ const cb = args.pop();
13515
+ fn.apply(this, args).then((value) => {
13516
+ try {
13517
+ reducer ? cb(null, ...reducer(value)) : cb(null, value);
13518
+ } catch (err) {
13519
+ cb(err);
13303
13520
  }
13304
- isRejected ? rejectPromise(value) : resolvePromise(value);
13305
- }
13306
- const resolve = function resolve2(value) {
13307
- done(value);
13308
- };
13309
- const reject = function reject2(value) {
13310
- done(value, true);
13311
- };
13312
- function abort(reason) {
13313
- emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
13521
+ }, cb);
13522
+ } : fn;
13523
+ };
13524
+ var callbackify_default = callbackify;
13525
+
13526
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/speedometer.js
13527
+ function speedometer(samplesCount, min) {
13528
+ samplesCount = samplesCount || 10;
13529
+ const bytes = new Array(samplesCount);
13530
+ const timestamps = new Array(samplesCount);
13531
+ let head = 0;
13532
+ let tail = 0;
13533
+ let firstSampleTS;
13534
+ min = min !== void 0 ? min : 1e3;
13535
+ return function push(chunkLength) {
13536
+ const now = Date.now();
13537
+ const startedAt = timestamps[tail];
13538
+ if (!firstSampleTS) {
13539
+ firstSampleTS = now;
13540
+ }
13541
+ bytes[head] = chunkLength;
13542
+ timestamps[head] = now;
13543
+ let i = tail;
13544
+ let bytesCount = 0;
13545
+ while (i !== head) {
13546
+ bytesCount += bytes[i++];
13547
+ i = i % samplesCount;
13548
+ }
13549
+ head = (head + 1) % samplesCount;
13550
+ if (head === tail) {
13551
+ tail = (tail + 1) % samplesCount;
13552
+ }
13553
+ if (now - firstSampleTS < min) {
13554
+ return;
13555
+ }
13556
+ const passed = startedAt && now - startedAt;
13557
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
13558
+ };
13559
+ }
13560
+ var speedometer_default = speedometer;
13561
+
13562
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/throttle.js
13563
+ function throttle(fn, freq) {
13564
+ let timestamp = 0;
13565
+ let threshold = 1e3 / freq;
13566
+ let lastArgs;
13567
+ let timer;
13568
+ const invoke = (args, now = Date.now()) => {
13569
+ timestamp = now;
13570
+ lastArgs = null;
13571
+ if (timer) {
13572
+ clearTimeout(timer);
13573
+ timer = null;
13574
+ }
13575
+ fn.apply(null, args);
13576
+ };
13577
+ const throttled = (...args) => {
13578
+ const now = Date.now();
13579
+ const passed = now - timestamp;
13580
+ if (passed >= threshold) {
13581
+ invoke(args, now);
13582
+ } else {
13583
+ lastArgs = args;
13584
+ if (!timer) {
13585
+ timer = setTimeout(() => {
13586
+ timer = null;
13587
+ invoke(lastArgs);
13588
+ }, threshold - passed);
13589
+ }
13590
+ }
13591
+ };
13592
+ const flush = () => lastArgs && invoke(lastArgs);
13593
+ return [throttled, flush];
13594
+ }
13595
+ var throttle_default = throttle;
13596
+
13597
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/progressEventReducer.js
13598
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
13599
+ let bytesNotified = 0;
13600
+ const _speedometer = speedometer_default(50, 250);
13601
+ return throttle_default((e) => {
13602
+ const loaded = e.loaded;
13603
+ const total = e.lengthComputable ? e.total : void 0;
13604
+ const progressBytes = loaded - bytesNotified;
13605
+ const rate = _speedometer(progressBytes);
13606
+ const inRange = loaded <= total;
13607
+ bytesNotified = loaded;
13608
+ const data = {
13609
+ loaded,
13610
+ total,
13611
+ progress: total ? loaded / total : void 0,
13612
+ bytes: progressBytes,
13613
+ rate: rate ? rate : void 0,
13614
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
13615
+ event: e,
13616
+ lengthComputable: total != null,
13617
+ [isDownloadStream ? "download" : "upload"]: true
13618
+ };
13619
+ listener(data);
13620
+ }, freq);
13621
+ };
13622
+ var progressEventDecorator = (total, throttled) => {
13623
+ const lengthComputable = total != null;
13624
+ return [(loaded) => throttled[0]({
13625
+ lengthComputable,
13626
+ total,
13627
+ loaded
13628
+ }), throttled[1]];
13629
+ };
13630
+ var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
13631
+
13632
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/http.js
13633
+ var zlibOptions = {
13634
+ flush: zlib.constants.Z_SYNC_FLUSH,
13635
+ finishFlush: zlib.constants.Z_SYNC_FLUSH
13636
+ };
13637
+ var brotliOptions = {
13638
+ flush: zlib.constants.BROTLI_OPERATION_FLUSH,
13639
+ finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
13640
+ };
13641
+ var isBrotliSupported = utils_default.isFunction(zlib.createBrotliDecompress);
13642
+ var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
13643
+ var isHttps = /https:?/;
13644
+ var supportedProtocols = platform_default.protocols.map((protocol) => {
13645
+ return protocol + ":";
13646
+ });
13647
+ var flushOnFinish = (stream4, [throttled, flush]) => {
13648
+ stream4.on("end", flush).on("error", flush);
13649
+ return throttled;
13650
+ };
13651
+ function dispatchBeforeRedirect(options, responseDetails) {
13652
+ if (options.beforeRedirects.proxy) {
13653
+ options.beforeRedirects.proxy(options);
13654
+ }
13655
+ if (options.beforeRedirects.config) {
13656
+ options.beforeRedirects.config(options, responseDetails);
13657
+ }
13658
+ }
13659
+ function setProxy(options, configProxy, location2) {
13660
+ let proxy = configProxy;
13661
+ if (!proxy && proxy !== false) {
13662
+ const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location2);
13663
+ if (proxyUrl) {
13664
+ proxy = new URL(proxyUrl);
13665
+ }
13666
+ }
13667
+ if (proxy) {
13668
+ if (proxy.username) {
13669
+ proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
13670
+ }
13671
+ if (proxy.auth) {
13672
+ if (proxy.auth.username || proxy.auth.password) {
13673
+ proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
13674
+ }
13675
+ const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
13676
+ options.headers["Proxy-Authorization"] = "Basic " + base64;
13677
+ }
13678
+ options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
13679
+ const proxyHost = proxy.hostname || proxy.host;
13680
+ options.hostname = proxyHost;
13681
+ options.host = proxyHost;
13682
+ options.port = proxy.port;
13683
+ options.path = location2;
13684
+ if (proxy.protocol) {
13685
+ options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
13686
+ }
13687
+ }
13688
+ options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
13689
+ setProxy(redirectOptions, configProxy, redirectOptions.href);
13690
+ };
13691
+ }
13692
+ var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
13693
+ var wrapAsync = (asyncExecutor) => {
13694
+ return new Promise((resolve, reject) => {
13695
+ let onDone;
13696
+ let isDone;
13697
+ const done = (value, isRejected) => {
13698
+ if (isDone)
13699
+ return;
13700
+ isDone = true;
13701
+ onDone && onDone(value, isRejected);
13702
+ };
13703
+ const _resolve = (value) => {
13704
+ done(value);
13705
+ resolve(value);
13706
+ };
13707
+ const _reject = (reason) => {
13708
+ done(reason, true);
13709
+ reject(reason);
13710
+ };
13711
+ asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
13712
+ });
13713
+ };
13714
+ var resolveFamily = ({ address, family }) => {
13715
+ if (!utils_default.isString(address)) {
13716
+ throw TypeError("address must be a string");
13717
+ }
13718
+ return {
13719
+ address,
13720
+ family: family || (address.indexOf(".") < 0 ? 6 : 4)
13721
+ };
13722
+ };
13723
+ var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
13724
+ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13725
+ return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
13726
+ let { data, lookup, family } = config;
13727
+ const { responseType, responseEncoding } = config;
13728
+ const method = config.method.toUpperCase();
13729
+ let isDone;
13730
+ let rejected = false;
13731
+ let req;
13732
+ if (lookup) {
13733
+ const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
13734
+ lookup = (hostname, opt, cb) => {
13735
+ _lookup(hostname, opt, (err, arg0, arg1) => {
13736
+ if (err) {
13737
+ return cb(err);
13738
+ }
13739
+ const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
13740
+ opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
13741
+ });
13742
+ };
13743
+ }
13744
+ const emitter = new EventEmitter();
13745
+ const onFinished = () => {
13746
+ if (config.cancelToken) {
13747
+ config.cancelToken.unsubscribe(abort);
13748
+ }
13749
+ if (config.signal) {
13750
+ config.signal.removeEventListener("abort", abort);
13751
+ }
13752
+ emitter.removeAllListeners();
13753
+ };
13754
+ onDone((value, isRejected) => {
13755
+ isDone = true;
13756
+ if (isRejected) {
13757
+ rejected = true;
13758
+ onFinished();
13759
+ }
13760
+ });
13761
+ function abort(reason) {
13762
+ emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
13314
13763
  }
13315
13764
  emitter.once("abort", reject);
13316
13765
  if (config.cancelToken || config.signal) {
@@ -13319,8 +13768,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13319
13768
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
13320
13769
  }
13321
13770
  }
13322
- const fullPath = buildFullPath(config.baseURL, config.url);
13323
- const parsed = new URL(fullPath);
13771
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
13772
+ const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
13324
13773
  const protocol = parsed.protocol || supportedProtocols[0];
13325
13774
  if (protocol === "data:") {
13326
13775
  let convertedData;
@@ -13342,10 +13791,10 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13342
13791
  if (responseType === "text") {
13343
13792
  convertedData = convertedData.toString(responseEncoding);
13344
13793
  if (!responseEncoding || responseEncoding === "utf8") {
13345
- data = utils_default.stripBOM(convertedData);
13794
+ convertedData = utils_default.stripBOM(convertedData);
13346
13795
  }
13347
13796
  } else if (responseType === "stream") {
13348
- convertedData = stream2.Readable.from(convertedData);
13797
+ convertedData = stream3.Readable.from(convertedData);
13349
13798
  }
13350
13799
  return settle(resolve, reject, {
13351
13800
  data: convertedData,
@@ -13364,13 +13813,31 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13364
13813
  }
13365
13814
  const headers = AxiosHeaders_default.from(config.headers).normalize();
13366
13815
  headers.set("User-Agent", "axios/" + VERSION, false);
13367
- const onDownloadProgress = config.onDownloadProgress;
13368
- const onUploadProgress = config.onUploadProgress;
13816
+ const { onUploadProgress, onDownloadProgress } = config;
13369
13817
  const maxRate = config.maxRate;
13370
13818
  let maxUploadRate = void 0;
13371
13819
  let maxDownloadRate = void 0;
13372
- if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
13820
+ if (utils_default.isSpecCompliantForm(data)) {
13821
+ const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
13822
+ data = formDataToStream_default(data, (formHeaders) => {
13823
+ headers.set(formHeaders);
13824
+ }, {
13825
+ tag: `axios-${VERSION}-boundary`,
13826
+ boundary: userBoundary && userBoundary[1] || void 0
13827
+ });
13828
+ } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
13373
13829
  headers.set(data.getHeaders());
13830
+ if (!headers.hasContentLength()) {
13831
+ try {
13832
+ const knownLength = await util2.promisify(data.getLength).call(data);
13833
+ Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
13834
+ } catch (e) {
13835
+ }
13836
+ }
13837
+ } else if (utils_default.isBlob(data) || utils_default.isFile(data)) {
13838
+ data.size && headers.setContentType(data.type || "application/octet-stream");
13839
+ headers.setContentLength(data.size || 0);
13840
+ data = stream3.Readable.from(readBlob_default(data));
13374
13841
  } else if (data && !utils_default.isStream(data)) {
13375
13842
  if (Buffer.isBuffer(data)) {
13376
13843
  } else if (utils_default.isArrayBuffer(data)) {
@@ -13384,7 +13851,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13384
13851
  config
13385
13852
  ));
13386
13853
  }
13387
- headers.set("Content-Length", data.length, false);
13854
+ headers.setContentLength(data.length, false);
13388
13855
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
13389
13856
  return reject(new AxiosError_default(
13390
13857
  "Request body larger than maxBodyLength limit",
@@ -13402,17 +13869,18 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13402
13869
  }
13403
13870
  if (data && (onUploadProgress || maxUploadRate)) {
13404
13871
  if (!utils_default.isStream(data)) {
13405
- data = stream2.Readable.from(data, { objectMode: false });
13872
+ data = stream3.Readable.from(data, { objectMode: false });
13406
13873
  }
13407
- data = stream2.pipeline([data, new AxiosTransformStream_default({
13408
- length: contentLength,
13874
+ data = stream3.pipeline([data, new AxiosTransformStream_default({
13409
13875
  maxRate: utils_default.toFiniteNumber(maxUploadRate)
13410
13876
  })], utils_default.noop);
13411
- onUploadProgress && data.on("progress", (progress) => {
13412
- onUploadProgress(Object.assign(progress, {
13413
- upload: true
13414
- }));
13415
- });
13877
+ onUploadProgress && data.on("progress", flushOnFinish(
13878
+ data,
13879
+ progressEventDecorator(
13880
+ contentLength,
13881
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
13882
+ )
13883
+ ));
13416
13884
  }
13417
13885
  let auth = void 0;
13418
13886
  if (config.auth) {
@@ -13452,13 +13920,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13452
13920
  agents: { http: config.httpAgent, https: config.httpsAgent },
13453
13921
  auth,
13454
13922
  protocol,
13923
+ family,
13455
13924
  beforeRedirect: dispatchBeforeRedirect,
13456
13925
  beforeRedirects: {}
13457
13926
  };
13927
+ !utils_default.isUndefined(lookup) && (options.lookup = lookup);
13458
13928
  if (config.socketPath) {
13459
13929
  options.socketPath = config.socketPath;
13460
13930
  } else {
13461
- options.hostname = parsed.hostname;
13931
+ options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
13462
13932
  options.port = parsed.port;
13463
13933
  setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
13464
13934
  }
@@ -13491,16 +13961,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13491
13961
  return;
13492
13962
  const streams = [res];
13493
13963
  const responseLength = +res.headers["content-length"];
13494
- if (onDownloadProgress) {
13964
+ if (onDownloadProgress || maxDownloadRate) {
13495
13965
  const transformStream = new AxiosTransformStream_default({
13496
- length: utils_default.toFiniteNumber(responseLength),
13497
13966
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
13498
13967
  });
13499
- onDownloadProgress && transformStream.on("progress", (progress) => {
13500
- onDownloadProgress(Object.assign(progress, {
13501
- download: true
13502
- }));
13503
- });
13968
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(
13969
+ transformStream,
13970
+ progressEventDecorator(
13971
+ responseLength,
13972
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
13973
+ )
13974
+ ));
13504
13975
  streams.push(transformStream);
13505
13976
  }
13506
13977
  let responseStream = res;
@@ -13509,22 +13980,28 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13509
13980
  if (method === "HEAD" || res.statusCode === 204) {
13510
13981
  delete res.headers["content-encoding"];
13511
13982
  }
13512
- switch (res.headers["content-encoding"]) {
13983
+ switch ((res.headers["content-encoding"] || "").toLowerCase()) {
13513
13984
  case "gzip":
13985
+ case "x-gzip":
13514
13986
  case "compress":
13987
+ case "x-compress":
13988
+ streams.push(zlib.createUnzip(zlibOptions));
13989
+ delete res.headers["content-encoding"];
13990
+ break;
13515
13991
  case "deflate":
13992
+ streams.push(new ZlibHeaderTransformStream_default());
13516
13993
  streams.push(zlib.createUnzip(zlibOptions));
13517
13994
  delete res.headers["content-encoding"];
13518
13995
  break;
13519
13996
  case "br":
13520
13997
  if (isBrotliSupported) {
13521
- streams.push(zlib.createBrotliDecompress(zlibOptions));
13998
+ streams.push(zlib.createBrotliDecompress(brotliOptions));
13522
13999
  delete res.headers["content-encoding"];
13523
14000
  }
13524
14001
  }
13525
14002
  }
13526
- responseStream = streams.length > 1 ? stream2.pipeline(streams, utils_default.noop) : streams[0];
13527
- const offListeners = stream2.finished(responseStream, () => {
14003
+ responseStream = streams.length > 1 ? stream3.pipeline(streams, utils_default.noop) : streams[0];
14004
+ const offListeners = stream3.finished(responseStream, () => {
13528
14005
  offListeners();
13529
14006
  onFinished();
13530
14007
  });
@@ -13560,7 +14037,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13560
14037
  return;
13561
14038
  }
13562
14039
  const err = new AxiosError_default(
13563
- "maxContentLength size of " + config.maxContentLength + " exceeded",
14040
+ "stream has been aborted",
13564
14041
  AxiosError_default.ERR_BAD_RESPONSE,
13565
14042
  config,
13566
14043
  lastRequest
@@ -13584,7 +14061,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13584
14061
  }
13585
14062
  response.data = responseData;
13586
14063
  } catch (err) {
13587
- reject(AxiosError_default.from(err, null, config, response.request, response));
14064
+ return reject(AxiosError_default.from(err, null, config, response.request, response));
13588
14065
  }
13589
14066
  settle(resolve, reject, response);
13590
14067
  });
@@ -13608,7 +14085,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13608
14085
  });
13609
14086
  if (config.timeout) {
13610
14087
  const timeout = parseInt(config.timeout, 10);
13611
- if (isNaN(timeout)) {
14088
+ if (Number.isNaN(timeout)) {
13612
14089
  reject(new AxiosError_default(
13613
14090
  "error trying to parse `config.timeout` to int",
13614
14091
  AxiosError_default.ERR_BAD_OPTION_VALUE,
@@ -13656,144 +14133,181 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
13656
14133
  });
13657
14134
  };
13658
14135
 
13659
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/cookies.js
13660
- var cookies_default = node_default.isStandardBrowserEnv ? (
13661
- // Standard browser envs support document.cookie
13662
- function standardBrowserEnv() {
13663
- return {
13664
- write: function write(name, value, expires, path, domain, secure) {
13665
- const cookie = [];
13666
- cookie.push(name + "=" + encodeURIComponent(value));
13667
- if (utils_default.isNumber(expires)) {
13668
- cookie.push("expires=" + new Date(expires).toGMTString());
13669
- }
13670
- if (utils_default.isString(path)) {
13671
- cookie.push("path=" + path);
13672
- }
13673
- if (utils_default.isString(domain)) {
13674
- cookie.push("domain=" + domain);
13675
- }
13676
- if (secure === true) {
13677
- cookie.push("secure");
13678
- }
13679
- document.cookie = cookie.join("; ");
13680
- },
13681
- read: function read(name) {
13682
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
13683
- return match ? decodeURIComponent(match[3]) : null;
13684
- },
13685
- remove: function remove(name) {
13686
- this.write(name, "", Date.now() - 864e5);
13687
- }
13688
- };
13689
- }()
13690
- ) : (
13691
- // Non standard browser env (web workers, react-native) lack needed support.
13692
- function nonStandardBrowserEnv() {
13693
- return {
13694
- write: function write() {
13695
- },
13696
- read: function read() {
13697
- return null;
13698
- },
13699
- remove: function remove() {
13700
- }
13701
- };
13702
- }()
13703
- );
14136
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/isURLSameOrigin.js
14137
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin2, isMSIE) => (url2) => {
14138
+ url2 = new URL(url2, platform_default.origin);
14139
+ return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
14140
+ })(
14141
+ new URL(platform_default.origin),
14142
+ platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
14143
+ ) : () => true;
13704
14144
 
13705
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/isURLSameOrigin.js
13706
- var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? (
13707
- // Standard browser envs have full support of the APIs needed to test
13708
- // whether the request URL is of the same origin as current location.
13709
- function standardBrowserEnv2() {
13710
- const msie = /(msie|trident)/i.test(navigator.userAgent);
13711
- const urlParsingNode = document.createElement("a");
13712
- let originURL;
13713
- function resolveURL(url2) {
13714
- let href = url2;
13715
- if (msie) {
13716
- urlParsingNode.setAttribute("href", href);
13717
- href = urlParsingNode.href;
13718
- }
13719
- urlParsingNode.setAttribute("href", href);
13720
- return {
13721
- href: urlParsingNode.href,
13722
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
13723
- host: urlParsingNode.host,
13724
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
13725
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
13726
- hostname: urlParsingNode.hostname,
13727
- port: urlParsingNode.port,
13728
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
13729
- };
14145
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/cookies.js
14146
+ var cookies_default = platform_default.hasStandardBrowserEnv ? (
14147
+ // Standard browser envs support document.cookie
14148
+ {
14149
+ write(name, value, expires, path, domain, secure) {
14150
+ const cookie = [name + "=" + encodeURIComponent(value)];
14151
+ utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
14152
+ utils_default.isString(path) && cookie.push("path=" + path);
14153
+ utils_default.isString(domain) && cookie.push("domain=" + domain);
14154
+ secure === true && cookie.push("secure");
14155
+ document.cookie = cookie.join("; ");
14156
+ },
14157
+ read(name) {
14158
+ const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
14159
+ return match ? decodeURIComponent(match[3]) : null;
14160
+ },
14161
+ remove(name) {
14162
+ this.write(name, "", Date.now() - 864e5);
13730
14163
  }
13731
- originURL = resolveURL(window.location.href);
13732
- return function isURLSameOrigin(requestURL) {
13733
- const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
13734
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
13735
- };
13736
- }()
14164
+ }
13737
14165
  ) : (
13738
- // Non standard browser envs (web workers, react-native) lack needed support.
13739
- function nonStandardBrowserEnv2() {
13740
- return function isURLSameOrigin() {
13741
- return true;
13742
- };
13743
- }()
14166
+ // Non-standard browser env (web workers, react-native) lack needed support.
14167
+ {
14168
+ write() {
14169
+ },
14170
+ read() {
14171
+ return null;
14172
+ },
14173
+ remove() {
14174
+ }
14175
+ }
13744
14176
  );
13745
14177
 
13746
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/adapters/xhr.js
13747
- function progressEventReducer(listener, isDownloadStream) {
13748
- let bytesNotified = 0;
13749
- const _speedometer = speedometer_default(50, 250);
13750
- return (e) => {
13751
- const loaded = e.loaded;
13752
- const total = e.lengthComputable ? e.total : void 0;
13753
- const progressBytes = loaded - bytesNotified;
13754
- const rate = _speedometer(progressBytes);
13755
- const inRange = loaded <= total;
13756
- bytesNotified = loaded;
13757
- const data = {
13758
- loaded,
13759
- total,
13760
- progress: total ? loaded / total : void 0,
13761
- bytes: progressBytes,
13762
- rate: rate ? rate : void 0,
13763
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
13764
- event: e
13765
- };
13766
- data[isDownloadStream ? "download" : "upload"] = true;
13767
- listener(data);
14178
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/mergeConfig.js
14179
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
14180
+ function mergeConfig(config1, config2) {
14181
+ config2 = config2 || {};
14182
+ const config = {};
14183
+ function getMergedValue(target, source, prop, caseless) {
14184
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
14185
+ return utils_default.merge.call({ caseless }, target, source);
14186
+ } else if (utils_default.isPlainObject(source)) {
14187
+ return utils_default.merge({}, source);
14188
+ } else if (utils_default.isArray(source)) {
14189
+ return source.slice();
14190
+ }
14191
+ return source;
14192
+ }
14193
+ function mergeDeepProperties(a, b, prop, caseless) {
14194
+ if (!utils_default.isUndefined(b)) {
14195
+ return getMergedValue(a, b, prop, caseless);
14196
+ } else if (!utils_default.isUndefined(a)) {
14197
+ return getMergedValue(void 0, a, prop, caseless);
14198
+ }
14199
+ }
14200
+ function valueFromConfig2(a, b) {
14201
+ if (!utils_default.isUndefined(b)) {
14202
+ return getMergedValue(void 0, b);
14203
+ }
14204
+ }
14205
+ function defaultToConfig2(a, b) {
14206
+ if (!utils_default.isUndefined(b)) {
14207
+ return getMergedValue(void 0, b);
14208
+ } else if (!utils_default.isUndefined(a)) {
14209
+ return getMergedValue(void 0, a);
14210
+ }
14211
+ }
14212
+ function mergeDirectKeys(a, b, prop) {
14213
+ if (prop in config2) {
14214
+ return getMergedValue(a, b);
14215
+ } else if (prop in config1) {
14216
+ return getMergedValue(void 0, a);
14217
+ }
14218
+ }
14219
+ const mergeMap = {
14220
+ url: valueFromConfig2,
14221
+ method: valueFromConfig2,
14222
+ data: valueFromConfig2,
14223
+ baseURL: defaultToConfig2,
14224
+ transformRequest: defaultToConfig2,
14225
+ transformResponse: defaultToConfig2,
14226
+ paramsSerializer: defaultToConfig2,
14227
+ timeout: defaultToConfig2,
14228
+ timeoutMessage: defaultToConfig2,
14229
+ withCredentials: defaultToConfig2,
14230
+ withXSRFToken: defaultToConfig2,
14231
+ adapter: defaultToConfig2,
14232
+ responseType: defaultToConfig2,
14233
+ xsrfCookieName: defaultToConfig2,
14234
+ xsrfHeaderName: defaultToConfig2,
14235
+ onUploadProgress: defaultToConfig2,
14236
+ onDownloadProgress: defaultToConfig2,
14237
+ decompress: defaultToConfig2,
14238
+ maxContentLength: defaultToConfig2,
14239
+ maxBodyLength: defaultToConfig2,
14240
+ beforeRedirect: defaultToConfig2,
14241
+ transport: defaultToConfig2,
14242
+ httpAgent: defaultToConfig2,
14243
+ httpsAgent: defaultToConfig2,
14244
+ cancelToken: defaultToConfig2,
14245
+ socketPath: defaultToConfig2,
14246
+ responseEncoding: defaultToConfig2,
14247
+ validateStatus: mergeDirectKeys,
14248
+ headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
13768
14249
  };
14250
+ utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
14251
+ const merge2 = mergeMap[prop] || mergeDeepProperties;
14252
+ const configValue = merge2(config1[prop], config2[prop], prop);
14253
+ utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
14254
+ });
14255
+ return config;
13769
14256
  }
14257
+
14258
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/resolveConfig.js
14259
+ var resolveConfig_default = (config) => {
14260
+ const newConfig = mergeConfig({}, config);
14261
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
14262
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
14263
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
14264
+ if (auth) {
14265
+ headers.set(
14266
+ "Authorization",
14267
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
14268
+ );
14269
+ }
14270
+ let contentType;
14271
+ if (utils_default.isFormData(data)) {
14272
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
14273
+ headers.setContentType(void 0);
14274
+ } else if ((contentType = headers.getContentType()) !== false) {
14275
+ const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
14276
+ headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
14277
+ }
14278
+ }
14279
+ if (platform_default.hasStandardBrowserEnv) {
14280
+ withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
14281
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
14282
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
14283
+ if (xsrfValue) {
14284
+ headers.set(xsrfHeaderName, xsrfValue);
14285
+ }
14286
+ }
14287
+ }
14288
+ return newConfig;
14289
+ };
14290
+
14291
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/xhr.js
13770
14292
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
13771
14293
  var xhr_default = isXHRAdapterSupported && function(config) {
13772
14294
  return new Promise(function dispatchXhrRequest(resolve, reject) {
13773
- let requestData = config.data;
13774
- const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
13775
- const responseType = config.responseType;
14295
+ const _config = resolveConfig_default(config);
14296
+ let requestData = _config.data;
14297
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
14298
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
13776
14299
  let onCanceled;
14300
+ let uploadThrottled, downloadThrottled;
14301
+ let flushUpload, flushDownload;
13777
14302
  function done() {
13778
- if (config.cancelToken) {
13779
- config.cancelToken.unsubscribe(onCanceled);
13780
- }
13781
- if (config.signal) {
13782
- config.signal.removeEventListener("abort", onCanceled);
13783
- }
13784
- }
13785
- if (utils_default.isFormData(requestData) && (node_default.isStandardBrowserEnv || node_default.isStandardBrowserWebWorkerEnv)) {
13786
- requestHeaders.setContentType(false);
14303
+ flushUpload && flushUpload();
14304
+ flushDownload && flushDownload();
14305
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
14306
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
13787
14307
  }
13788
14308
  let request = new XMLHttpRequest();
13789
- if (config.auth) {
13790
- const username = config.auth.username || "";
13791
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
13792
- requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
13793
- }
13794
- const fullPath = buildFullPath(config.baseURL, config.url);
13795
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
13796
- request.timeout = config.timeout;
14309
+ request.open(_config.method.toUpperCase(), _config.url, true);
14310
+ request.timeout = _config.timeout;
13797
14311
  function onloadend() {
13798
14312
  if (!request) {
13799
14313
  return;
@@ -13844,10 +14358,10 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13844
14358
  request = null;
13845
14359
  };
13846
14360
  request.ontimeout = function handleTimeout() {
13847
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
13848
- const transitional2 = config.transitional || transitional_default;
13849
- if (config.timeoutErrorMessage) {
13850
- timeoutErrorMessage = config.timeoutErrorMessage;
14361
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
14362
+ const transitional2 = _config.transitional || transitional_default;
14363
+ if (_config.timeoutErrorMessage) {
14364
+ timeoutErrorMessage = _config.timeoutErrorMessage;
13851
14365
  }
13852
14366
  reject(new AxiosError_default(
13853
14367
  timeoutErrorMessage,
@@ -13857,31 +14371,28 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13857
14371
  ));
13858
14372
  request = null;
13859
14373
  };
13860
- if (node_default.isStandardBrowserEnv) {
13861
- const xsrfValue = (config.withCredentials || isURLSameOrigin_default(fullPath)) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
13862
- if (xsrfValue) {
13863
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
13864
- }
13865
- }
13866
14374
  requestData === void 0 && requestHeaders.setContentType(null);
13867
14375
  if ("setRequestHeader" in request) {
13868
14376
  utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
13869
14377
  request.setRequestHeader(key, val);
13870
14378
  });
13871
14379
  }
13872
- if (!utils_default.isUndefined(config.withCredentials)) {
13873
- request.withCredentials = !!config.withCredentials;
14380
+ if (!utils_default.isUndefined(_config.withCredentials)) {
14381
+ request.withCredentials = !!_config.withCredentials;
13874
14382
  }
13875
14383
  if (responseType && responseType !== "json") {
13876
- request.responseType = config.responseType;
14384
+ request.responseType = _config.responseType;
13877
14385
  }
13878
- if (typeof config.onDownloadProgress === "function") {
13879
- request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
14386
+ if (onDownloadProgress) {
14387
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
14388
+ request.addEventListener("progress", downloadThrottled);
13880
14389
  }
13881
- if (typeof config.onUploadProgress === "function" && request.upload) {
13882
- request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
14390
+ if (onUploadProgress && request.upload) {
14391
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
14392
+ request.upload.addEventListener("progress", uploadThrottled);
14393
+ request.upload.addEventListener("loadend", flushUpload);
13883
14394
  }
13884
- if (config.cancelToken || config.signal) {
14395
+ if (_config.cancelToken || _config.signal) {
13885
14396
  onCanceled = (cancel) => {
13886
14397
  if (!request) {
13887
14398
  return;
@@ -13890,13 +14401,13 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13890
14401
  request.abort();
13891
14402
  request = null;
13892
14403
  };
13893
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
13894
- if (config.signal) {
13895
- config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
14404
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
14405
+ if (_config.signal) {
14406
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
13896
14407
  }
13897
14408
  }
13898
- const protocol = parseProtocol(fullPath);
13899
- if (protocol && node_default.protocols.indexOf(protocol) === -1) {
14409
+ const protocol = parseProtocol(_config.url);
14410
+ if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
13900
14411
  reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
13901
14412
  return;
13902
14413
  }
@@ -13904,10 +14415,288 @@ var xhr_default = isXHRAdapterSupported && function(config) {
13904
14415
  });
13905
14416
  };
13906
14417
 
13907
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/adapters/adapters.js
14418
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/composeSignals.js
14419
+ var composeSignals = (signals, timeout) => {
14420
+ const { length } = signals = signals ? signals.filter(Boolean) : [];
14421
+ if (timeout || length) {
14422
+ let controller = new AbortController();
14423
+ let aborted;
14424
+ const onabort = function(reason) {
14425
+ if (!aborted) {
14426
+ aborted = true;
14427
+ unsubscribe();
14428
+ const err = reason instanceof Error ? reason : this.reason;
14429
+ controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
14430
+ }
14431
+ };
14432
+ let timer = timeout && setTimeout(() => {
14433
+ timer = null;
14434
+ onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
14435
+ }, timeout);
14436
+ const unsubscribe = () => {
14437
+ if (signals) {
14438
+ timer && clearTimeout(timer);
14439
+ timer = null;
14440
+ signals.forEach((signal2) => {
14441
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
14442
+ });
14443
+ signals = null;
14444
+ }
14445
+ };
14446
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
14447
+ const { signal } = controller;
14448
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
14449
+ return signal;
14450
+ }
14451
+ };
14452
+ var composeSignals_default = composeSignals;
14453
+
14454
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/trackStream.js
14455
+ var streamChunk = function* (chunk, chunkSize) {
14456
+ let len = chunk.byteLength;
14457
+ if (!chunkSize || len < chunkSize) {
14458
+ yield chunk;
14459
+ return;
14460
+ }
14461
+ let pos = 0;
14462
+ let end;
14463
+ while (pos < len) {
14464
+ end = pos + chunkSize;
14465
+ yield chunk.slice(pos, end);
14466
+ pos = end;
14467
+ }
14468
+ };
14469
+ var readBytes = async function* (iterable, chunkSize) {
14470
+ for await (const chunk of readStream(iterable)) {
14471
+ yield* streamChunk(chunk, chunkSize);
14472
+ }
14473
+ };
14474
+ var readStream = async function* (stream4) {
14475
+ if (stream4[Symbol.asyncIterator]) {
14476
+ yield* stream4;
14477
+ return;
14478
+ }
14479
+ const reader = stream4.getReader();
14480
+ try {
14481
+ for (; ; ) {
14482
+ const { done, value } = await reader.read();
14483
+ if (done) {
14484
+ break;
14485
+ }
14486
+ yield value;
14487
+ }
14488
+ } finally {
14489
+ await reader.cancel();
14490
+ }
14491
+ };
14492
+ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
14493
+ const iterator3 = readBytes(stream4, chunkSize);
14494
+ let bytes = 0;
14495
+ let done;
14496
+ let _onFinish = (e) => {
14497
+ if (!done) {
14498
+ done = true;
14499
+ onFinish && onFinish(e);
14500
+ }
14501
+ };
14502
+ return new ReadableStream({
14503
+ async pull(controller) {
14504
+ try {
14505
+ const { done: done2, value } = await iterator3.next();
14506
+ if (done2) {
14507
+ _onFinish();
14508
+ controller.close();
14509
+ return;
14510
+ }
14511
+ let len = value.byteLength;
14512
+ if (onProgress) {
14513
+ let loadedBytes = bytes += len;
14514
+ onProgress(loadedBytes);
14515
+ }
14516
+ controller.enqueue(new Uint8Array(value));
14517
+ } catch (err) {
14518
+ _onFinish(err);
14519
+ throw err;
14520
+ }
14521
+ },
14522
+ cancel(reason) {
14523
+ _onFinish(reason);
14524
+ return iterator3.return();
14525
+ }
14526
+ }, {
14527
+ highWaterMark: 2
14528
+ });
14529
+ };
14530
+
14531
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/fetch.js
14532
+ var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
14533
+ var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
14534
+ var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
14535
+ var test = (fn, ...args) => {
14536
+ try {
14537
+ return !!fn(...args);
14538
+ } catch (e) {
14539
+ return false;
14540
+ }
14541
+ };
14542
+ var supportsRequestStream = isReadableStreamSupported && test(() => {
14543
+ let duplexAccessed = false;
14544
+ const hasContentType = new Request(platform_default.origin, {
14545
+ body: new ReadableStream(),
14546
+ method: "POST",
14547
+ get duplex() {
14548
+ duplexAccessed = true;
14549
+ return "half";
14550
+ }
14551
+ }).headers.has("Content-Type");
14552
+ return duplexAccessed && !hasContentType;
14553
+ });
14554
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
14555
+ var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
14556
+ var resolvers = {
14557
+ stream: supportsResponseStream && ((res) => res.body)
14558
+ };
14559
+ isFetchSupported && ((res) => {
14560
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
14561
+ !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
14562
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
14563
+ });
14564
+ });
14565
+ })(new Response());
14566
+ var getBodyLength = async (body) => {
14567
+ if (body == null) {
14568
+ return 0;
14569
+ }
14570
+ if (utils_default.isBlob(body)) {
14571
+ return body.size;
14572
+ }
14573
+ if (utils_default.isSpecCompliantForm(body)) {
14574
+ const _request = new Request(platform_default.origin, {
14575
+ method: "POST",
14576
+ body
14577
+ });
14578
+ return (await _request.arrayBuffer()).byteLength;
14579
+ }
14580
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
14581
+ return body.byteLength;
14582
+ }
14583
+ if (utils_default.isURLSearchParams(body)) {
14584
+ body = body + "";
14585
+ }
14586
+ if (utils_default.isString(body)) {
14587
+ return (await encodeText(body)).byteLength;
14588
+ }
14589
+ };
14590
+ var resolveBodyLength = async (headers, body) => {
14591
+ const length = utils_default.toFiniteNumber(headers.getContentLength());
14592
+ return length == null ? getBodyLength(body) : length;
14593
+ };
14594
+ var fetch_default = isFetchSupported && (async (config) => {
14595
+ let {
14596
+ url: url2,
14597
+ method,
14598
+ data,
14599
+ signal,
14600
+ cancelToken,
14601
+ timeout,
14602
+ onDownloadProgress,
14603
+ onUploadProgress,
14604
+ responseType,
14605
+ headers,
14606
+ withCredentials = "same-origin",
14607
+ fetchOptions
14608
+ } = resolveConfig_default(config);
14609
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
14610
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
14611
+ let request;
14612
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
14613
+ composedSignal.unsubscribe();
14614
+ });
14615
+ let requestContentLength;
14616
+ try {
14617
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
14618
+ let _request = new Request(url2, {
14619
+ method: "POST",
14620
+ body: data,
14621
+ duplex: "half"
14622
+ });
14623
+ let contentTypeHeader;
14624
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
14625
+ headers.setContentType(contentTypeHeader);
14626
+ }
14627
+ if (_request.body) {
14628
+ const [onProgress, flush] = progressEventDecorator(
14629
+ requestContentLength,
14630
+ progressEventReducer(asyncDecorator(onUploadProgress))
14631
+ );
14632
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
14633
+ }
14634
+ }
14635
+ if (!utils_default.isString(withCredentials)) {
14636
+ withCredentials = withCredentials ? "include" : "omit";
14637
+ }
14638
+ const isCredentialsSupported = "credentials" in Request.prototype;
14639
+ request = new Request(url2, {
14640
+ ...fetchOptions,
14641
+ signal: composedSignal,
14642
+ method: method.toUpperCase(),
14643
+ headers: headers.normalize().toJSON(),
14644
+ body: data,
14645
+ duplex: "half",
14646
+ credentials: isCredentialsSupported ? withCredentials : void 0
14647
+ });
14648
+ let response = await fetch(request);
14649
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
14650
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
14651
+ const options = {};
14652
+ ["status", "statusText", "headers"].forEach((prop) => {
14653
+ options[prop] = response[prop];
14654
+ });
14655
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
14656
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
14657
+ responseContentLength,
14658
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
14659
+ ) || [];
14660
+ response = new Response(
14661
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
14662
+ flush && flush();
14663
+ unsubscribe && unsubscribe();
14664
+ }),
14665
+ options
14666
+ );
14667
+ }
14668
+ responseType = responseType || "text";
14669
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
14670
+ !isStreamResponse && unsubscribe && unsubscribe();
14671
+ return await new Promise((resolve, reject) => {
14672
+ settle(resolve, reject, {
14673
+ data: responseData,
14674
+ headers: AxiosHeaders_default.from(response.headers),
14675
+ status: response.status,
14676
+ statusText: response.statusText,
14677
+ config,
14678
+ request
14679
+ });
14680
+ });
14681
+ } catch (err) {
14682
+ unsubscribe && unsubscribe();
14683
+ if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
14684
+ throw Object.assign(
14685
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
14686
+ {
14687
+ cause: err.cause || err
14688
+ }
14689
+ );
14690
+ }
14691
+ throw AxiosError_default.from(err, err && err.code, config, request);
14692
+ }
14693
+ });
14694
+
14695
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/adapters/adapters.js
13908
14696
  var knownAdapters = {
13909
14697
  http: http_default,
13910
- xhr: xhr_default
14698
+ xhr: xhr_default,
14699
+ fetch: fetch_default
13911
14700
  };
13912
14701
  utils_default.forEach(knownAdapters, (fn, value) => {
13913
14702
  if (fn) {
@@ -13918,38 +14707,46 @@ utils_default.forEach(knownAdapters, (fn, value) => {
13918
14707
  Object.defineProperty(fn, "adapterName", { value });
13919
14708
  }
13920
14709
  });
14710
+ var renderReason = (reason) => `- ${reason}`;
14711
+ var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
13921
14712
  var adapters_default = {
13922
14713
  getAdapter: (adapters) => {
13923
14714
  adapters = utils_default.isArray(adapters) ? adapters : [adapters];
13924
14715
  const { length } = adapters;
13925
14716
  let nameOrAdapter;
13926
14717
  let adapter;
14718
+ const rejectedReasons = {};
13927
14719
  for (let i = 0; i < length; i++) {
13928
14720
  nameOrAdapter = adapters[i];
13929
- if (adapter = utils_default.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
14721
+ let id;
14722
+ adapter = nameOrAdapter;
14723
+ if (!isResolvedHandle(nameOrAdapter)) {
14724
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
14725
+ if (adapter === void 0) {
14726
+ throw new AxiosError_default(`Unknown adapter '${id}'`);
14727
+ }
14728
+ }
14729
+ if (adapter) {
13930
14730
  break;
13931
14731
  }
14732
+ rejectedReasons[id || "#" + i] = adapter;
13932
14733
  }
13933
14734
  if (!adapter) {
13934
- if (adapter === false) {
13935
- throw new AxiosError_default(
13936
- `Adapter ${nameOrAdapter} is not supported by the environment`,
13937
- "ERR_NOT_SUPPORT"
13938
- );
13939
- }
13940
- throw new Error(
13941
- utils_default.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
14735
+ const reasons = Object.entries(rejectedReasons).map(
14736
+ ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
14737
+ );
14738
+ let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
14739
+ throw new AxiosError_default(
14740
+ `There is no suitable adapter to dispatch the request ` + s,
14741
+ "ERR_NOT_SUPPORT"
13942
14742
  );
13943
- }
13944
- if (!utils_default.isFunction(adapter)) {
13945
- throw new TypeError("adapter is not a function");
13946
14743
  }
13947
14744
  return adapter;
13948
14745
  },
13949
14746
  adapters: knownAdapters
13950
14747
  };
13951
14748
 
13952
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/dispatchRequest.js
14749
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/dispatchRequest.js
13953
14750
  function throwIfCancellationRequested(config) {
13954
14751
  if (config.cancelToken) {
13955
14752
  config.cancelToken.throwIfRequested();
@@ -13994,86 +14791,7 @@ function dispatchRequest(config) {
13994
14791
  });
13995
14792
  }
13996
14793
 
13997
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/mergeConfig.js
13998
- var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
13999
- function mergeConfig(config1, config2) {
14000
- config2 = config2 || {};
14001
- const config = {};
14002
- function getMergedValue(target, source, caseless) {
14003
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
14004
- return utils_default.merge.call({ caseless }, target, source);
14005
- } else if (utils_default.isPlainObject(source)) {
14006
- return utils_default.merge({}, source);
14007
- } else if (utils_default.isArray(source)) {
14008
- return source.slice();
14009
- }
14010
- return source;
14011
- }
14012
- function mergeDeepProperties(a, b, caseless) {
14013
- if (!utils_default.isUndefined(b)) {
14014
- return getMergedValue(a, b, caseless);
14015
- } else if (!utils_default.isUndefined(a)) {
14016
- return getMergedValue(void 0, a, caseless);
14017
- }
14018
- }
14019
- function valueFromConfig2(a, b) {
14020
- if (!utils_default.isUndefined(b)) {
14021
- return getMergedValue(void 0, b);
14022
- }
14023
- }
14024
- function defaultToConfig2(a, b) {
14025
- if (!utils_default.isUndefined(b)) {
14026
- return getMergedValue(void 0, b);
14027
- } else if (!utils_default.isUndefined(a)) {
14028
- return getMergedValue(void 0, a);
14029
- }
14030
- }
14031
- function mergeDirectKeys(a, b, prop) {
14032
- if (prop in config2) {
14033
- return getMergedValue(a, b);
14034
- } else if (prop in config1) {
14035
- return getMergedValue(void 0, a);
14036
- }
14037
- }
14038
- const mergeMap = {
14039
- url: valueFromConfig2,
14040
- method: valueFromConfig2,
14041
- data: valueFromConfig2,
14042
- baseURL: defaultToConfig2,
14043
- transformRequest: defaultToConfig2,
14044
- transformResponse: defaultToConfig2,
14045
- paramsSerializer: defaultToConfig2,
14046
- timeout: defaultToConfig2,
14047
- timeoutMessage: defaultToConfig2,
14048
- withCredentials: defaultToConfig2,
14049
- adapter: defaultToConfig2,
14050
- responseType: defaultToConfig2,
14051
- xsrfCookieName: defaultToConfig2,
14052
- xsrfHeaderName: defaultToConfig2,
14053
- onUploadProgress: defaultToConfig2,
14054
- onDownloadProgress: defaultToConfig2,
14055
- decompress: defaultToConfig2,
14056
- maxContentLength: defaultToConfig2,
14057
- maxBodyLength: defaultToConfig2,
14058
- beforeRedirect: defaultToConfig2,
14059
- transport: defaultToConfig2,
14060
- httpAgent: defaultToConfig2,
14061
- httpsAgent: defaultToConfig2,
14062
- cancelToken: defaultToConfig2,
14063
- socketPath: defaultToConfig2,
14064
- responseEncoding: defaultToConfig2,
14065
- validateStatus: mergeDirectKeys,
14066
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
14067
- };
14068
- utils_default.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
14069
- const merge2 = mergeMap[prop] || mergeDeepProperties;
14070
- const configValue = merge2(config1[prop], config2[prop], prop);
14071
- utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
14072
- });
14073
- return config;
14074
- }
14075
-
14076
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/validator.js
14794
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/validator.js
14077
14795
  var validators = {};
14078
14796
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
14079
14797
  validators[type] = function validator(thing) {
@@ -14104,6 +14822,12 @@ validators.transitional = function transitional(validator, version, message) {
14104
14822
  return validator ? validator(value, opt, opts) : true;
14105
14823
  };
14106
14824
  };
14825
+ validators.spelling = function spelling(correctSpelling) {
14826
+ return (value, opt) => {
14827
+ console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
14828
+ return true;
14829
+ };
14830
+ };
14107
14831
  function assertOptions(options, schema, allowUnknown) {
14108
14832
  if (typeof options !== "object") {
14109
14833
  throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
@@ -14131,11 +14855,11 @@ var validator_default = {
14131
14855
  validators
14132
14856
  };
14133
14857
 
14134
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/core/Axios.js
14858
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/core/Axios.js
14135
14859
  var validators2 = validator_default.validators;
14136
14860
  var Axios = class {
14137
14861
  constructor(instanceConfig) {
14138
- this.defaults = instanceConfig;
14862
+ this.defaults = instanceConfig || {};
14139
14863
  this.interceptors = {
14140
14864
  request: new InterceptorManager_default(),
14141
14865
  response: new InterceptorManager_default()
@@ -14149,7 +14873,27 @@ var Axios = class {
14149
14873
  *
14150
14874
  * @returns {Promise} The Promise to be fulfilled
14151
14875
  */
14152
- request(configOrUrl, config) {
14876
+ async request(configOrUrl, config) {
14877
+ try {
14878
+ return await this._request(configOrUrl, config);
14879
+ } catch (err) {
14880
+ if (err instanceof Error) {
14881
+ let dummy = {};
14882
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
14883
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
14884
+ try {
14885
+ if (!err.stack) {
14886
+ err.stack = stack;
14887
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
14888
+ err.stack += "\n" + stack;
14889
+ }
14890
+ } catch (e) {
14891
+ }
14892
+ }
14893
+ throw err;
14894
+ }
14895
+ }
14896
+ _request(configOrUrl, config) {
14153
14897
  if (typeof configOrUrl === "string") {
14154
14898
  config = config || {};
14155
14899
  config.url = configOrUrl;
@@ -14165,19 +14909,34 @@ var Axios = class {
14165
14909
  clarifyTimeoutError: validators2.transitional(validators2.boolean)
14166
14910
  }, false);
14167
14911
  }
14168
- if (paramsSerializer !== void 0) {
14169
- validator_default.assertOptions(paramsSerializer, {
14170
- encode: validators2.function,
14171
- serialize: validators2.function
14172
- }, true);
14912
+ if (paramsSerializer != null) {
14913
+ if (utils_default.isFunction(paramsSerializer)) {
14914
+ config.paramsSerializer = {
14915
+ serialize: paramsSerializer
14916
+ };
14917
+ } else {
14918
+ validator_default.assertOptions(paramsSerializer, {
14919
+ encode: validators2.function,
14920
+ serialize: validators2.function
14921
+ }, true);
14922
+ }
14173
14923
  }
14924
+ if (config.allowAbsoluteUrls !== void 0) {
14925
+ } else if (this.defaults.allowAbsoluteUrls !== void 0) {
14926
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
14927
+ } else {
14928
+ config.allowAbsoluteUrls = true;
14929
+ }
14930
+ validator_default.assertOptions(config, {
14931
+ baseUrl: validators2.spelling("baseURL"),
14932
+ withXsrfToken: validators2.spelling("withXSRFToken")
14933
+ }, true);
14174
14934
  config.method = (config.method || this.defaults.method || "get").toLowerCase();
14175
- let contextHeaders;
14176
- contextHeaders = headers && utils_default.merge(
14935
+ let contextHeaders = headers && utils_default.merge(
14177
14936
  headers.common,
14178
14937
  headers[config.method]
14179
14938
  );
14180
- contextHeaders && utils_default.forEach(
14939
+ headers && utils_default.forEach(
14181
14940
  ["delete", "get", "head", "post", "put", "patch", "common"],
14182
14941
  (method) => {
14183
14942
  delete headers[method];
@@ -14238,11 +14997,11 @@ var Axios = class {
14238
14997
  }
14239
14998
  getUri(config) {
14240
14999
  config = mergeConfig(this.defaults, config);
14241
- const fullPath = buildFullPath(config.baseURL, config.url);
15000
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
14242
15001
  return buildURL(fullPath, config.params, config.paramsSerializer);
14243
15002
  }
14244
15003
  };
14245
- utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
15004
+ utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
14246
15005
  Axios.prototype[method] = function(url2, config) {
14247
15006
  return this.request(mergeConfig(config || {}, {
14248
15007
  method,
@@ -14251,7 +15010,7 @@ utils_default.forEach(["delete", "get", "head", "options"], function forEachMeth
14251
15010
  }));
14252
15011
  };
14253
15012
  });
14254
- utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
15013
+ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
14255
15014
  function generateHTTPMethod(isForm) {
14256
15015
  return function httpMethod(url2, data, config) {
14257
15016
  return this.request(mergeConfig(config || {}, {
@@ -14269,7 +15028,7 @@ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData2(
14269
15028
  });
14270
15029
  var Axios_default = Axios;
14271
15030
 
14272
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/cancel/CancelToken.js
15031
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/cancel/CancelToken.js
14273
15032
  var CancelToken = class _CancelToken {
14274
15033
  constructor(executor) {
14275
15034
  if (typeof executor !== "function") {
@@ -14342,6 +15101,15 @@ var CancelToken = class _CancelToken {
14342
15101
  this._listeners.splice(index, 1);
14343
15102
  }
14344
15103
  }
15104
+ toAbortSignal() {
15105
+ const controller = new AbortController();
15106
+ const abort = (err) => {
15107
+ controller.abort(err);
15108
+ };
15109
+ this.subscribe(abort);
15110
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
15111
+ return controller.signal;
15112
+ }
14345
15113
  /**
14346
15114
  * Returns an object that contains a new `CancelToken` and a function that, when called,
14347
15115
  * cancels the `CancelToken`.
@@ -14359,19 +15127,90 @@ var CancelToken = class _CancelToken {
14359
15127
  };
14360
15128
  var CancelToken_default = CancelToken;
14361
15129
 
14362
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/spread.js
15130
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/spread.js
14363
15131
  function spread(callback) {
14364
15132
  return function wrap(arr) {
14365
15133
  return callback.apply(null, arr);
14366
15134
  };
14367
15135
  }
14368
15136
 
14369
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/helpers/isAxiosError.js
15137
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/isAxiosError.js
14370
15138
  function isAxiosError(payload) {
14371
15139
  return utils_default.isObject(payload) && payload.isAxiosError === true;
14372
15140
  }
14373
15141
 
14374
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/lib/axios.js
15142
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/HttpStatusCode.js
15143
+ var HttpStatusCode = {
15144
+ Continue: 100,
15145
+ SwitchingProtocols: 101,
15146
+ Processing: 102,
15147
+ EarlyHints: 103,
15148
+ Ok: 200,
15149
+ Created: 201,
15150
+ Accepted: 202,
15151
+ NonAuthoritativeInformation: 203,
15152
+ NoContent: 204,
15153
+ ResetContent: 205,
15154
+ PartialContent: 206,
15155
+ MultiStatus: 207,
15156
+ AlreadyReported: 208,
15157
+ ImUsed: 226,
15158
+ MultipleChoices: 300,
15159
+ MovedPermanently: 301,
15160
+ Found: 302,
15161
+ SeeOther: 303,
15162
+ NotModified: 304,
15163
+ UseProxy: 305,
15164
+ Unused: 306,
15165
+ TemporaryRedirect: 307,
15166
+ PermanentRedirect: 308,
15167
+ BadRequest: 400,
15168
+ Unauthorized: 401,
15169
+ PaymentRequired: 402,
15170
+ Forbidden: 403,
15171
+ NotFound: 404,
15172
+ MethodNotAllowed: 405,
15173
+ NotAcceptable: 406,
15174
+ ProxyAuthenticationRequired: 407,
15175
+ RequestTimeout: 408,
15176
+ Conflict: 409,
15177
+ Gone: 410,
15178
+ LengthRequired: 411,
15179
+ PreconditionFailed: 412,
15180
+ PayloadTooLarge: 413,
15181
+ UriTooLong: 414,
15182
+ UnsupportedMediaType: 415,
15183
+ RangeNotSatisfiable: 416,
15184
+ ExpectationFailed: 417,
15185
+ ImATeapot: 418,
15186
+ MisdirectedRequest: 421,
15187
+ UnprocessableEntity: 422,
15188
+ Locked: 423,
15189
+ FailedDependency: 424,
15190
+ TooEarly: 425,
15191
+ UpgradeRequired: 426,
15192
+ PreconditionRequired: 428,
15193
+ TooManyRequests: 429,
15194
+ RequestHeaderFieldsTooLarge: 431,
15195
+ UnavailableForLegalReasons: 451,
15196
+ InternalServerError: 500,
15197
+ NotImplemented: 501,
15198
+ BadGateway: 502,
15199
+ ServiceUnavailable: 503,
15200
+ GatewayTimeout: 504,
15201
+ HttpVersionNotSupported: 505,
15202
+ VariantAlsoNegotiates: 506,
15203
+ InsufficientStorage: 507,
15204
+ LoopDetected: 508,
15205
+ NotExtended: 510,
15206
+ NetworkAuthenticationRequired: 511
15207
+ };
15208
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
15209
+ HttpStatusCode[value] = key;
15210
+ });
15211
+ var HttpStatusCode_default = HttpStatusCode;
15212
+
15213
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/axios.js
14375
15214
  function createInstance(defaultConfig) {
14376
15215
  const context = new Axios_default(defaultConfig);
14377
15216
  const instance = bind(Axios_default.prototype.request, context);
@@ -14399,10 +15238,12 @@ axios.isAxiosError = isAxiosError;
14399
15238
  axios.mergeConfig = mergeConfig;
14400
15239
  axios.AxiosHeaders = AxiosHeaders_default;
14401
15240
  axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
15241
+ axios.getAdapter = adapters_default.getAdapter;
15242
+ axios.HttpStatusCode = HttpStatusCode_default;
14402
15243
  axios.default = axios;
14403
15244
  var axios_default = axios;
14404
15245
 
14405
- // ../../node_modules/.pnpm/axios@1.2.1/node_modules/axios/index.js
15246
+ // ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/index.js
14406
15247
  var {
14407
15248
  Axios: Axios2,
14408
15249
  AxiosError: AxiosError2,
@@ -14416,7 +15257,9 @@ var {
14416
15257
  spread: spread2,
14417
15258
  toFormData: toFormData2,
14418
15259
  AxiosHeaders: AxiosHeaders2,
15260
+ HttpStatusCode: HttpStatusCode2,
14419
15261
  formToJSON,
15262
+ getAdapter,
14420
15263
  mergeConfig: mergeConfig2
14421
15264
  } = axios_default;
14422
15265
 
@@ -14433,7 +15276,6 @@ var AbstractAuthenticationApi = class {
14433
15276
  };
14434
15277
 
14435
15278
  // src/api/OAuthApi.ts
14436
- import { Credentials as Credentials2 } from "@dstny/scp-credentials";
14437
15279
  var OAuthApi = class extends AbstractAuthenticationApi {
14438
15280
  clientId;
14439
15281
  scope;
@@ -14460,7 +15302,7 @@ var OAuthApi = class extends AbstractAuthenticationApi {
14460
15302
  redirect_uri: redirectUri
14461
15303
  })
14462
15304
  );
14463
- return new Credentials2(data.access_token, data.refresh_token, data.expires_in);
15305
+ return new Credentials(data.access_token, data.refresh_token, data.expires_in);
14464
15306
  }
14465
15307
  async loginWithUsernamePassword(username, password) {
14466
15308
  const { data } = await this.axiosInstance.post(
@@ -14472,7 +15314,7 @@ var OAuthApi = class extends AbstractAuthenticationApi {
14472
15314
  password
14473
15315
  })
14474
15316
  );
14475
- return new Credentials2(data.access_token, data.refresh_token, data.expires_in);
15317
+ return new Credentials(data.access_token, data.refresh_token, data.expires_in);
14476
15318
  }
14477
15319
  async refreshToken(refreshToken, accessToken) {
14478
15320
  try {
@@ -14484,7 +15326,7 @@ var OAuthApi = class extends AbstractAuthenticationApi {
14484
15326
  refresh_token: refreshToken
14485
15327
  })
14486
15328
  );
14487
- return new Credentials2(
15329
+ return new Credentials(
14488
15330
  response.data.access_token,
14489
15331
  response.data.refresh_token,
14490
15332
  response.data.expires_in
@@ -14511,7 +15353,6 @@ var OAuthApi = class extends AbstractAuthenticationApi {
14511
15353
  };
14512
15354
 
14513
15355
  // src/api/SmgAuthApi.ts
14514
- import { Credentials as Credentials3 } from "@dstny/scp-credentials";
14515
15356
  var SmgAuthApi = class extends AbstractAuthenticationApi {
14516
15357
  clientId;
14517
15358
  realm;
@@ -14546,7 +15387,7 @@ var SmgAuthApi = class extends AbstractAuthenticationApi {
14546
15387
  const expires_in = exp - iat;
14547
15388
  const expires_at = /* @__PURE__ */ new Date();
14548
15389
  expires_at.setSeconds(expires_at.getSeconds() + expires_in);
14549
- return new Credentials3(accessToken, refreshToken, expires_in);
15390
+ return new Credentials(accessToken, refreshToken, expires_in);
14550
15391
  }
14551
15392
  async refreshToken(refreshToken, accessToken) {
14552
15393
  try {
@@ -14562,7 +15403,7 @@ var SmgAuthApi = class extends AbstractAuthenticationApi {
14562
15403
  const { refreshToken: newRefreshToken, accessToken: newAccessToken } = data;
14563
15404
  const { iat = 0, exp = 0 } = decodeToken(newAccessToken);
14564
15405
  const expires_in = exp - iat;
14565
- return new Credentials3(newAccessToken, newRefreshToken, expires_in);
15406
+ return new Credentials(newAccessToken, newRefreshToken, expires_in);
14566
15407
  } catch (error) {
14567
15408
  if (axios_default.isAxiosError(error)) {
14568
15409
  if (error.message === "Network Error") {