free-pi-cli 0.6.20 → 0.6.22

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.
@@ -11332,7 +11332,7 @@ var require_dist = __commonJS(function(exports, module) {
11332
11332
  module.exports = createHttpsProxyAgent;
11333
11333
  });
11334
11334
 
11335
- // ../../node_modules/.bun/follow-redirects@1.16.1+676106343bee98f0/node_modules/follow-redirects/debug.js
11335
+ // ../../node_modules/.bun/follow-redirects@1.16.3+676106343bee98f0/node_modules/follow-redirects/debug.js
11336
11336
  var require_debug = __commonJS(function(exports, module) {
11337
11337
  var debug;
11338
11338
  module.exports = function() {
@@ -11348,7 +11348,7 @@ var require_debug = __commonJS(function(exports, module) {
11348
11348
  };
11349
11349
  });
11350
11350
 
11351
- // ../../node_modules/.bun/follow-redirects@1.16.1+676106343bee98f0/node_modules/follow-redirects/index.js
11351
+ // ../../node_modules/.bun/follow-redirects@1.16.3+676106343bee98f0/node_modules/follow-redirects/index.js
11352
11352
  var require_follow_redirects = __commonJS(function(exports, module) {
11353
11353
  var url = __require("url");
11354
11354
  var URL2 = url.URL;
@@ -11567,7 +11567,7 @@ var require_follow_redirects = __commonJS(function(exports, module) {
11567
11567
  options.headers[headerList[i]] = headerList[i + 1];
11568
11568
  }
11569
11569
  }
11570
- if (!isArray(options.sensitiveHeaders)) {
11570
+ if (!Array.isArray(options.sensitiveHeaders)) {
11571
11571
  options.sensitiveHeaders = [];
11572
11572
  }
11573
11573
  if (options.host) {
@@ -11814,9 +11814,6 @@ var require_follow_redirects = __commonJS(function(exports, module) {
11814
11814
  var dot = subdomain.length - domain.length - 1;
11815
11815
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
11816
11816
  }
11817
- function isArray(value) {
11818
- return value instanceof Array;
11819
- }
11820
11817
  function isString(value) {
11821
11818
  return typeof value === "string" || value instanceof String;
11822
11819
  }
@@ -11830,13 +11827,13 @@ var require_follow_redirects = __commonJS(function(exports, module) {
11830
11827
  return URL2 && value instanceof URL2;
11831
11828
  }
11832
11829
  function escapeRegex(regex) {
11833
- return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
11830
+ return regex.replace(/[\^$\\.*+?()[\]{}|]/g, "\\$&");
11834
11831
  }
11835
11832
  module.exports = wrap({ http, https });
11836
11833
  module.exports.wrap = wrap;
11837
11834
  });
11838
11835
 
11839
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/common/utils.js
11836
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/common/utils.js
11840
11837
  var exports_utils = {};
11841
11838
  __export(exports_utils, {
11842
11839
  hasBrowserEnv: () => hasBrowserEnv,
@@ -11846,7 +11843,7 @@ __export(exports_utils, {
11846
11843
  origin: () => origin
11847
11844
  });
11848
11845
 
11849
- // ../../node_modules/.bun/@gravity-ai+api@1.2.1+676106343bee98f0/node_modules/@gravity-ai/api/dist/chunk-EBO3CZXG.mjs
11846
+ // ../../node_modules/.bun/@gravity-ai+api@1.4.0+676106343bee98f0/node_modules/@gravity-ai/api/dist/chunk-F4FGMBDK.mjs
11850
11847
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
11851
11848
  var __require2 = /* @__PURE__ */ ((x) => __require)(function(x) {
11852
11849
  if (true)
@@ -11854,17 +11851,21 @@ var __require2 = /* @__PURE__ */ ((x) => __require)(function(x) {
11854
11851
  throw Error('Dynamic require of "' + x + '" is not supported');
11855
11852
  });
11856
11853
  var __commonJS2 = (cb, mod) => function __require2() {
11857
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11854
+ try {
11855
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11856
+ } catch (e) {
11857
+ throw mod = 0, e;
11858
+ }
11858
11859
  };
11859
11860
 
11860
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/bind.js
11861
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/bind.js
11861
11862
  function bind(fn, thisArg) {
11862
11863
  return function wrap() {
11863
11864
  return fn.apply(thisArg, arguments);
11864
11865
  };
11865
11866
  }
11866
11867
 
11867
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/utils.js
11868
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/utils.js
11868
11869
  var { toString } = Object.prototype;
11869
11870
  var { getPrototypeOf } = Object;
11870
11871
  var { iterator, toStringTag } = Symbol;
@@ -11979,7 +11980,7 @@ var isPlainObject = (val) => {
11979
11980
  return false;
11980
11981
  }
11981
11982
  const prototype = getPrototypeOf(val);
11982
- return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
11983
+ return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && (isPrototypeBoundary(val, prototype, true) || !hasOwnProperty(val, toStringTag) && !hasOwnProperty(val, iterator));
11983
11984
  };
11984
11985
  var isEmptyObject = (val) => {
11985
11986
  if (!isObject(val) || isBuffer(val)) {
@@ -12088,11 +12089,21 @@ var isContextDefined = (context) => !isUndefined(context) && context !== _global
12088
12089
  function merge(...objs) {
12089
12090
  const { caseless, skipUndefined } = isContextDefined(this) && this || {};
12090
12091
  const result = {};
12092
+ const lowerCaseKeys = caseless ? Object.create(null) : null;
12091
12093
  const assignValue = (val, key) => {
12092
12094
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
12093
12095
  return;
12094
12096
  }
12095
- const targetKey = caseless && typeof key === "string" && findKey(result, key) || key;
12097
+ let targetKey = key;
12098
+ if (lowerCaseKeys && typeof key === "string") {
12099
+ const lowerKey = key.toLowerCase();
12100
+ const knownKey = lowerCaseKeys[lowerKey];
12101
+ if (knownKey !== undefined && hasOwnProperty(result, knownKey)) {
12102
+ targetKey = knownKey;
12103
+ } else {
12104
+ lowerCaseKeys[lowerKey] = key;
12105
+ }
12106
+ }
12096
12107
  const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
12097
12108
  if (isPlainObject(existing) && isPlainObject(val)) {
12098
12109
  result[targetKey] = merge(existing, val);
@@ -12110,7 +12121,7 @@ function merge(...objs) {
12110
12121
  continue;
12111
12122
  }
12112
12123
  forEach(source, assignValue);
12113
- if (typeof source !== "object" || isArray(source)) {
12124
+ if (typeof source !== "object" || isArray(source) || !Object.getOwnPropertySymbols) {
12114
12125
  continue;
12115
12126
  }
12116
12127
  const symbols = Object.getOwnPropertySymbols(source);
@@ -12203,7 +12214,27 @@ var toArray = (thing) => {
12203
12214
  if (isArray(thing))
12204
12215
  return thing;
12205
12216
  let i = thing.length;
12206
- if (!isNumber(i))
12217
+ if (!Number.isSafeInteger(i) || i < 0 || i > 4294967295)
12218
+ return null;
12219
+ const indexes = new Set;
12220
+ const seen = new Set;
12221
+ let source = thing;
12222
+ while (source != null && indexes.size < i) {
12223
+ if (seen.has(source))
12224
+ return null;
12225
+ seen.add(source);
12226
+ const prototype = getPrototypeOf(source);
12227
+ if (isPrototypeBoundary(source, prototype, source === thing))
12228
+ break;
12229
+ Object.getOwnPropertyNames(source).forEach((key) => {
12230
+ const index = +key;
12231
+ if (Number.isInteger(index) && index >= 0 && index < i && String(index) === key && hasOwnProperty(source, key)) {
12232
+ indexes.add(index);
12233
+ }
12234
+ });
12235
+ source = prototype;
12236
+ }
12237
+ if (indexes.size !== i)
12207
12238
  return null;
12208
12239
  const arr = new Array(i);
12209
12240
  while (i-- > 0) {
@@ -12410,7 +12441,7 @@ var utils_default = {
12410
12441
  isSafeIterable
12411
12442
  };
12412
12443
 
12413
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/parseHeaders.js
12444
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/parseHeaders.js
12414
12445
  var ignoreDuplicateOf = utils_default.toObjectSet([
12415
12446
  "age",
12416
12447
  "authorization",
@@ -12431,7 +12462,7 @@ var ignoreDuplicateOf = utils_default.toObjectSet([
12431
12462
  "user-agent"
12432
12463
  ]);
12433
12464
  var parseHeaders_default = (rawHeaders) => {
12434
- const parsed = {};
12465
+ const parsed = Object.create(null);
12435
12466
  let key;
12436
12467
  let val;
12437
12468
  let i;
@@ -12457,7 +12488,7 @@ var parseHeaders_default = (rawHeaders) => {
12457
12488
  return parsed;
12458
12489
  };
12459
12490
 
12460
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/sanitizeHeaderValue.js
12491
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/sanitizeHeaderValue.js
12461
12492
  function trimSPorHTAB(str) {
12462
12493
  let start = 0;
12463
12494
  let end = str.length;
@@ -12495,7 +12526,7 @@ function toByteStringHeaderObject(headers) {
12495
12526
  return byteStringHeaders;
12496
12527
  }
12497
12528
 
12498
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/AxiosHeaders.js
12529
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/AxiosHeaders.js
12499
12530
  var $internals = Symbol("internals");
12500
12531
  function normalizeHeader(header) {
12501
12532
  return header && String(header).trim().toLowerCase();
@@ -12600,9 +12631,11 @@ function parseParameters(value) {
12600
12631
  return parameters;
12601
12632
  }
12602
12633
  var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
12634
+ var PROTO_HEADER_SLOT = "__Proto__";
12635
+ var headerSlot = (name) => name === "__proto__" ? PROTO_HEADER_SLOT : name;
12603
12636
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
12604
12637
  if (utils_default.isFunction(filter)) {
12605
- return filter.call(this, value, header);
12638
+ return filter.call(context, value, header);
12606
12639
  }
12607
12640
  if (isHeaderNameFilter) {
12608
12641
  value = header;
@@ -12647,7 +12680,7 @@ class AxiosHeaders {
12647
12680
  }
12648
12681
  const key = utils_default.findKey(self2, lHeader);
12649
12682
  if (!key || self2[key] === undefined || _rewrite === true || _rewrite === undefined && self2[key] !== false) {
12650
- self2[key || _header] = normalizeValue(_value);
12683
+ self2[headerSlot(key || _header)] = normalizeValue(_value);
12651
12684
  }
12652
12685
  }
12653
12686
  const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
@@ -12740,7 +12773,7 @@ class AxiosHeaders {
12740
12773
  }
12741
12774
  normalize(format) {
12742
12775
  const self2 = this;
12743
- const headers = {};
12776
+ const headers = Object.create(null);
12744
12777
  utils_default.forEach(this, (value, header) => {
12745
12778
  const key = utils_default.findKey(headers, header);
12746
12779
  if (key) {
@@ -12748,7 +12781,7 @@ class AxiosHeaders {
12748
12781
  delete self2[header];
12749
12782
  return;
12750
12783
  }
12751
- const normalized = format ? formatHeader(header) : String(header).trim();
12784
+ const normalized = headerSlot(format ? formatHeader(header) : String(header).trim());
12752
12785
  if (normalized !== header) {
12753
12786
  delete self2[header];
12754
12787
  }
@@ -12829,7 +12862,7 @@ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
12829
12862
  utils_default.freezeMethods(AxiosHeaders);
12830
12863
  var AxiosHeaders_default = AxiosHeaders;
12831
12864
 
12832
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/AxiosError.js
12865
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/AxiosError.js
12833
12866
  var REDACTED = "[REDACTED ****]";
12834
12867
  function hasOwnOrPrototypeToJSON(source) {
12835
12868
  if (utils_default.hasOwnProp(source, "toJSON")) {
@@ -12902,6 +12935,28 @@ function aggregateErrorMessage(error) {
12902
12935
  }).filter(Boolean).join("; ");
12903
12936
  return message || error.name || "AggregateError";
12904
12937
  }
12938
+ var CAUSED_BY_SEPARATOR = `
12939
+ Caused by: `;
12940
+ var $causeStack = Symbol("causeStack");
12941
+ function getCauseStackIndex(error, stack) {
12942
+ const causeStack = utils_default.hasOwnProp(error, $causeStack) && error[$causeStack];
12943
+ return causeStack && stack.endsWith(causeStack) ? stack.length - causeStack.length : -1;
12944
+ }
12945
+ function appendCauseStack(target, source) {
12946
+ try {
12947
+ const sourceStack = source && source.stack;
12948
+ if (typeof sourceStack !== "string" || !sourceStack) {
12949
+ return;
12950
+ }
12951
+ const targetStack = target.stack;
12952
+ if (typeof targetStack !== "string" || !targetStack) {
12953
+ return;
12954
+ }
12955
+ const causeStack = CAUSED_BY_SEPARATOR + sourceStack;
12956
+ target.stack = targetStack + causeStack;
12957
+ Object.defineProperty(target, $causeStack, { __proto__: null, value: causeStack });
12958
+ } catch (e) {}
12959
+ }
12905
12960
 
12906
12961
  class AxiosError extends Error {
12907
12962
  static from(error, code, config, request, response, customProps) {
@@ -12918,6 +12973,7 @@ class AxiosError extends Error {
12918
12973
  configurable: true
12919
12974
  });
12920
12975
  axiosError.name = error.name;
12976
+ appendCauseStack(axiosError, error);
12921
12977
  if (error.status != null && axiosError.status == null) {
12922
12978
  axiosError.status = error.status;
12923
12979
  }
@@ -12978,11 +13034,11 @@ AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
12978
13034
  AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
12979
13035
  var AxiosError_default = AxiosError;
12980
13036
 
12981
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/node/classes/FormData.js
13037
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/node/classes/FormData.js
12982
13038
  var import_form_data = __toESM(require_form_data(), 1);
12983
13039
  var FormData_default = import_form_data.default;
12984
13040
 
12985
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/node/classes/Buffer.js
13041
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/node/classes/Buffer.js
12986
13042
  var Buffer_default = {
12987
13043
  isBufferAvailable() {
12988
13044
  return typeof Buffer !== "undefined";
@@ -12992,7 +13048,7 @@ var Buffer_default = {
12992
13048
  }
12993
13049
  };
12994
13050
 
12995
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/toFormData.js
13051
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/toFormData.js
12996
13052
  var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
12997
13053
  function isVisitable(thing) {
12998
13054
  return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
@@ -13132,7 +13188,7 @@ function toFormData(obj, formData, options) {
13132
13188
  }
13133
13189
  var toFormData_default = toFormData;
13134
13190
 
13135
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
13191
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
13136
13192
  function encode(str) {
13137
13193
  const charMap = {
13138
13194
  "!": "%21",
@@ -13162,7 +13218,7 @@ prototype.toString = function toString(encoder) {
13162
13218
  };
13163
13219
  var AxiosURLSearchParams_default = AxiosURLSearchParams;
13164
13220
 
13165
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/buildURL.js
13221
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/buildURL.js
13166
13222
  function encode2(val) {
13167
13223
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
13168
13224
  }
@@ -13192,7 +13248,7 @@ function buildURL(url, params, options) {
13192
13248
  return url;
13193
13249
  }
13194
13250
 
13195
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/InterceptorManager.js
13251
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/InterceptorManager.js
13196
13252
  var $internals2 = Symbol("internals");
13197
13253
  function countHandlers(handlers) {
13198
13254
  return handlers ? handlers.length : 0;
@@ -13205,6 +13261,12 @@ function trimHandlers(handlers) {
13205
13261
  handlers.pop();
13206
13262
  }
13207
13263
  }
13264
+ function normalizeHandlerId(id) {
13265
+ if (typeof id === "string" && id !== "" && String(Number(id)) === id) {
13266
+ return Number(id);
13267
+ }
13268
+ return id;
13269
+ }
13208
13270
  function syncHandlerEntries(manager, internals) {
13209
13271
  const handlers = manager.handlers;
13210
13272
  const length = countHandlers(handlers);
@@ -13260,9 +13322,10 @@ class InterceptorManager {
13260
13322
  eject(id) {
13261
13323
  const internals = this[$internals2];
13262
13324
  syncHandlerEntries(this, internals);
13263
- const entry = internals.handlerEntries.get(id);
13325
+ const handlerId = normalizeHandlerId(id);
13326
+ const entry = internals.handlerEntries.get(handlerId);
13264
13327
  if (entry) {
13265
- internals.handlerEntries.delete(id);
13328
+ internals.handlerEntries.delete(handlerId);
13266
13329
  if (this.handlers[entry.index] !== entry.handler) {
13267
13330
  return;
13268
13331
  }
@@ -13300,24 +13363,25 @@ class InterceptorManager {
13300
13363
  }
13301
13364
  var InterceptorManager_default = InterceptorManager;
13302
13365
 
13303
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/defaults/transitional.js
13366
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/defaults/transitional.js
13304
13367
  var transitional_default = {
13305
13368
  silentJSONParsing: true,
13306
13369
  forcedJSONParsing: true,
13307
13370
  clarifyTimeoutError: false,
13308
13371
  legacyInterceptorReqResOrdering: true,
13309
13372
  advertiseZstdAcceptEncoding: false,
13310
- validateStatusUndefinedResolves: true
13373
+ validateStatusUndefinedResolves: true,
13374
+ encodeBasicAuthUsername: false
13311
13375
  };
13312
13376
 
13313
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/node/index.js
13377
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/node/index.js
13314
13378
  import crypto from "crypto";
13315
13379
 
13316
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
13380
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
13317
13381
  import url from "url";
13318
13382
  var URLSearchParams_default = url.URLSearchParams;
13319
13383
 
13320
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/node/index.js
13384
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/node/index.js
13321
13385
  var ALPHA = "abcdefghijklmnopqrstuvwxyz";
13322
13386
  var DIGIT = "0123456789";
13323
13387
  var ALPHABET = {
@@ -13347,7 +13411,7 @@ var node_default = {
13347
13411
  protocols: ["http", "https", "file", "data"]
13348
13412
  };
13349
13413
 
13350
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/common/utils.js
13414
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/common/utils.js
13351
13415
  var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
13352
13416
  var _navigator = typeof navigator === "object" && navigator || undefined;
13353
13417
  var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
@@ -13356,13 +13420,13 @@ var hasStandardBrowserWebWorkerEnv = (() => {
13356
13420
  })();
13357
13421
  var origin = hasBrowserEnv && window.location.href || "http://localhost";
13358
13422
 
13359
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/platform/index.js
13423
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/platform/index.js
13360
13424
  var platform_default = {
13361
13425
  ...exports_utils,
13362
13426
  ...node_default
13363
13427
  };
13364
13428
 
13365
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/toURLEncodedForm.js
13429
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/toURLEncodedForm.js
13366
13430
  function toURLEncodedForm(data, options) {
13367
13431
  return toFormData_default(data, new platform_default.classes.URLSearchParams, {
13368
13432
  visitor: function(value, key, path, helpers) {
@@ -13376,7 +13440,7 @@ function toURLEncodedForm(data, options) {
13376
13440
  });
13377
13441
  }
13378
13442
 
13379
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/formDataToJSON.js
13443
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/formDataToJSON.js
13380
13444
  var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
13381
13445
  function throwIfDepthExceeded(index) {
13382
13446
  if (index > MAX_DEPTH) {
@@ -13405,6 +13469,25 @@ function arrayToObject(arr) {
13405
13469
  }
13406
13470
  return obj;
13407
13471
  }
13472
+ function normalizeArray(value) {
13473
+ if (!utils_default.isArray(value))
13474
+ return value;
13475
+ const keys = Object.keys(value);
13476
+ return keys.length !== value.length || keys.some((key, index) => key !== String(index)) ? arrayToObject(value) : value;
13477
+ }
13478
+ function normalizeArrays(obj) {
13479
+ const pending = [obj];
13480
+ while (pending.length) {
13481
+ const target = pending.pop();
13482
+ Object.keys(target).forEach((key) => {
13483
+ const value = target[key] = normalizeArray(target[key]);
13484
+ if (utils_default.isArray(value) || utils_default.isPlainObject(value)) {
13485
+ pending.push(value);
13486
+ }
13487
+ });
13488
+ }
13489
+ return obj;
13490
+ }
13408
13491
  function formDataToJSON(formData) {
13409
13492
  function buildPath(path, value, target, index) {
13410
13493
  throwIfDepthExceeded(index);
@@ -13416,6 +13499,7 @@ function formDataToJSON(formData) {
13416
13499
  name = !name && utils_default.isArray(target) ? target.length : name;
13417
13500
  if (isLast) {
13418
13501
  if (utils_default.hasOwnProp(target, name)) {
13502
+ target[name] = normalizeArray(target[name]);
13419
13503
  target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
13420
13504
  } else {
13421
13505
  target[name] = value;
@@ -13436,13 +13520,13 @@ function formDataToJSON(formData) {
13436
13520
  utils_default.forEachEntry(formData, (name, value) => {
13437
13521
  buildPath(parsePropPath(name), value, obj, 0);
13438
13522
  });
13439
- return obj;
13523
+ return normalizeArrays(obj);
13440
13524
  }
13441
13525
  return null;
13442
13526
  }
13443
13527
  var formDataToJSON_default = formDataToJSON;
13444
13528
 
13445
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/methodList.js
13529
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/methodList.js
13446
13530
  var methodList = Object.freeze([
13447
13531
  "get",
13448
13532
  "delete",
@@ -13458,7 +13542,7 @@ var methodList = Object.freeze([
13458
13542
  ]);
13459
13543
  var methodList_default = methodList;
13460
13544
 
13461
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/defaults/index.js
13545
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/defaults/index.js
13462
13546
  var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : undefined;
13463
13547
  function stringifySafely2(rawValue, parser, encoder) {
13464
13548
  if (utils_default.isString(rawValue)) {
@@ -13567,7 +13651,7 @@ utils_default.forEach(methodList_default, (method) => {
13567
13651
  });
13568
13652
  var defaults_default = defaults;
13569
13653
 
13570
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/transformData.js
13654
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/transformData.js
13571
13655
  function transformData(fns, response) {
13572
13656
  const config = this || defaults_default;
13573
13657
  const context = response || config;
@@ -13580,12 +13664,12 @@ function transformData(fns, response) {
13580
13664
  return data;
13581
13665
  }
13582
13666
 
13583
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/cancel/isCancel.js
13667
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/cancel/isCancel.js
13584
13668
  function isCancel(value) {
13585
13669
  return !!(value && value.__CANCEL__);
13586
13670
  }
13587
13671
 
13588
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/cancel/CanceledError.js
13672
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/cancel/CanceledError.js
13589
13673
  class CanceledError extends AxiosError_default {
13590
13674
  constructor(message, config, request) {
13591
13675
  super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
@@ -13595,7 +13679,7 @@ class CanceledError extends AxiosError_default {
13595
13679
  }
13596
13680
  var CanceledError_default = CanceledError;
13597
13681
 
13598
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/settle.js
13682
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/settle.js
13599
13683
  function settle(resolve, reject, response) {
13600
13684
  const validateStatus = response.config.validateStatus;
13601
13685
  if (!response.status || !validateStatus || validateStatus(response.status)) {
@@ -13605,7 +13689,7 @@ function settle(resolve, reject, response) {
13605
13689
  }
13606
13690
  }
13607
13691
 
13608
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/isAbsoluteURL.js
13692
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/isAbsoluteURL.js
13609
13693
  function isAbsoluteURL(url) {
13610
13694
  if (typeof url !== "string") {
13611
13695
  return false;
@@ -13613,7 +13697,7 @@ function isAbsoluteURL(url) {
13613
13697
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
13614
13698
  }
13615
13699
 
13616
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/combineURLs.js
13700
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/combineURLs.js
13617
13701
  function combineURLs(baseURL, relativeURL) {
13618
13702
  if (!relativeURL) {
13619
13703
  return baseURL;
@@ -13625,7 +13709,7 @@ function combineURLs(baseURL, relativeURL) {
13625
13709
  return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
13626
13710
  }
13627
13711
 
13628
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
13712
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js
13629
13713
  var urlParserControlCharacters = /[\t\n\r]/g;
13630
13714
  function normalizeURLForProtocolCheck(url) {
13631
13715
  if (typeof url !== "string") {
@@ -13638,7 +13722,7 @@ function normalizeURLForProtocolCheck(url) {
13638
13722
  return url.slice(start).replace(urlParserControlCharacters, "");
13639
13723
  }
13640
13724
 
13641
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/buildFullPath.js
13725
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/buildFullPath.js
13642
13726
  var malformedHttpProtocol = /^https?:(?!\/\/)/i;
13643
13727
  function redactFragment(fragment) {
13644
13728
  if (!fragment) {
@@ -13743,7 +13827,7 @@ function getEnv(key) {
13743
13827
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
13744
13828
  }
13745
13829
 
13746
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/http.js
13830
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/http.js
13747
13831
  var import_https_proxy_agent = __toESM(require_dist(), 1);
13748
13832
  var import_follow_redirects = __toESM(require_follow_redirects(), 1);
13749
13833
  import http from "http";
@@ -13753,17 +13837,17 @@ import util3 from "util";
13753
13837
  import { resolve as resolvePath } from "path";
13754
13838
  import zlib from "zlib";
13755
13839
 
13756
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/env/data.js
13757
- var VERSION = "1.20.0";
13840
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/env/data.js
13841
+ var VERSION = "1.21.1";
13758
13842
 
13759
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/parseProtocol.js
13843
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/parseProtocol.js
13760
13844
  function parseProtocol(url) {
13761
13845
  const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
13762
- return match && match[1] || "";
13846
+ return match && match[1].toLowerCase() || "";
13763
13847
  }
13764
13848
 
13765
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/fromDataURI.js
13766
- var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
13849
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/fromDataURI.js
13850
+ var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/i;
13767
13851
  function fromDataURI(uri, asBlob, options) {
13768
13852
  const _Blob = options && options.Blob || platform_default.classes.Blob;
13769
13853
  const protocol = parseProtocol(uri);
@@ -13786,7 +13870,7 @@ function fromDataURI(uri, asBlob, options) {
13786
13870
  } else if (params) {
13787
13871
  mime = "text/plain" + params;
13788
13872
  }
13789
- const buffer = encoding === "base64" ? Buffer.from(body, "base64") : Buffer.from(decodeURIComponent(body), encoding);
13873
+ const buffer = encoding === "base64" ? Buffer.from(body.replace(/%([\da-f]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))), "base64") : Buffer.from(decodeURIComponent(body), encoding);
13790
13874
  if (asBlob) {
13791
13875
  if (!_Blob) {
13792
13876
  throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
@@ -13798,10 +13882,10 @@ function fromDataURI(uri, asBlob, options) {
13798
13882
  throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
13799
13883
  }
13800
13884
 
13801
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/http.js
13885
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/http.js
13802
13886
  import stream3 from "stream";
13803
13887
 
13804
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/setFormDataHeaders.js
13888
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/setFormDataHeaders.js
13805
13889
  var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
13806
13890
  function setFormDataHeaders(headers, formHeaders, policy) {
13807
13891
  if (policy !== "content-only") {
@@ -13815,7 +13899,7 @@ function setFormDataHeaders(headers, formHeaders, policy) {
13815
13899
  });
13816
13900
  }
13817
13901
 
13818
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/AxiosTransformStream.js
13902
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/AxiosTransformStream.js
13819
13903
  import stream from "stream";
13820
13904
  var kInternals = Symbol("internals");
13821
13905
 
@@ -13868,7 +13952,10 @@ class AxiosTransformStream extends stream.Transform {
13868
13952
  const timeWindow = internals.timeWindow;
13869
13953
  const divider = 1000 / timeWindow;
13870
13954
  const bytesThreshold = maxRate / divider;
13871
- const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
13955
+ let minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
13956
+ if (maxRate) {
13957
+ minChunkSize = Math.min(bytesThreshold, minChunkSize);
13958
+ }
13872
13959
  const pushChunk = (_chunk, _callback) => {
13873
13960
  const bytes = Buffer.byteLength(_chunk);
13874
13961
  internals.bytesSeen += bytes;
@@ -13884,6 +13971,9 @@ class AxiosTransformStream extends stream.Transform {
13884
13971
  }
13885
13972
  };
13886
13973
  const transformChunk = (_chunk, _callback) => {
13974
+ if (this.destroyed) {
13975
+ return _callback();
13976
+ }
13887
13977
  const chunkSize = Buffer.byteLength(_chunk);
13888
13978
  let chunkRemainder = null;
13889
13979
  let maxChunkSize = readableHighWaterMark;
@@ -13906,7 +13996,7 @@ class AxiosTransformStream extends stream.Transform {
13906
13996
  }, timeWindow - passed);
13907
13997
  }
13908
13998
  if (bytesLeft < maxChunkSize) {
13909
- maxChunkSize = bytesLeft;
13999
+ maxChunkSize = Math.max(1, Math.floor(bytesLeft));
13910
14000
  }
13911
14001
  }
13912
14002
  if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
@@ -13931,14 +14021,14 @@ class AxiosTransformStream extends stream.Transform {
13931
14021
  }
13932
14022
  var AxiosTransformStream_default = AxiosTransformStream;
13933
14023
 
13934
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/http.js
14024
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/http.js
13935
14025
  import { EventEmitter } from "events";
13936
14026
 
13937
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/formDataToStream.js
14027
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/formDataToStream.js
13938
14028
  import util from "util";
13939
14029
  import { Readable } from "stream";
13940
14030
 
13941
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/readBlob.js
14031
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/readBlob.js
13942
14032
  var { asyncIterator } = Symbol;
13943
14033
  var readBlob = async function* (blob) {
13944
14034
  if (blob.stream) {
@@ -13953,7 +14043,7 @@ var readBlob = async function* (blob) {
13953
14043
  };
13954
14044
  var readBlob_default = readBlob;
13955
14045
 
13956
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/formDataToStream.js
14046
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/formDataToStream.js
13957
14047
  var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
13958
14048
  var textEncoder = typeof TextEncoder === "function" ? new TextEncoder : new util.TextEncoder;
13959
14049
  var CRLF = `\r
@@ -14035,7 +14125,7 @@ var formDataToStream = (form, headersHandler, options) => {
14035
14125
  };
14036
14126
  var formDataToStream_default = formDataToStream;
14037
14127
 
14038
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
14128
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
14039
14129
  import stream2 from "stream";
14040
14130
 
14041
14131
  class ZlibHeaderTransformStream extends stream2.Transform {
@@ -14058,7 +14148,7 @@ class ZlibHeaderTransformStream extends stream2.Transform {
14058
14148
  }
14059
14149
  var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
14060
14150
 
14061
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/Http2Sessions.js
14151
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/Http2Sessions.js
14062
14152
  import http2 from "http2";
14063
14153
  import util2 from "util";
14064
14154
 
@@ -14119,7 +14209,7 @@ class Http2Sessions {
14119
14209
  timer = null;
14120
14210
  }
14121
14211
  stream.once("close", () => {
14122
- if (!--streamsCount) {
14212
+ if (!--streamsCount && !removed) {
14123
14213
  timer = setTimeout(() => {
14124
14214
  timer = null;
14125
14215
  removeSession();
@@ -14131,6 +14221,7 @@ class Http2Sessions {
14131
14221
  }
14132
14222
  session.once("close", removeSession);
14133
14223
  session.once("error", removeSession);
14224
+ session.once("goaway", removeSession);
14134
14225
  let entry = [session, options];
14135
14226
  authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
14136
14227
  return session;
@@ -14138,7 +14229,7 @@ class Http2Sessions {
14138
14229
  }
14139
14230
  var Http2Sessions_default = Http2Sessions;
14140
14231
 
14141
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/callbackify.js
14232
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/callbackify.js
14142
14233
  var callbackify = (fn, reducer) => {
14143
14234
  return utils_default.isAsyncFn(fn) ? function(...args) {
14144
14235
  const cb = args.pop();
@@ -14153,7 +14244,8 @@ var callbackify = (fn, reducer) => {
14153
14244
  };
14154
14245
  var callbackify_default = callbackify;
14155
14246
 
14156
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/shouldBypassProxy.js
14247
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/shouldBypassProxy.js
14248
+ import { domainToASCII } from "url";
14157
14249
  var LOOPBACK_HOSTNAMES = new Set(["localhost", "0.0.0.0"]);
14158
14250
  var trimTrailingDots = (value) => {
14159
14251
  let end = value.length;
@@ -14367,7 +14459,21 @@ var normalizeNoProxyHost = (hostname) => {
14367
14459
  if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
14368
14460
  hostname = hostname.slice(1, -1);
14369
14461
  }
14370
- const trimmed = trimTrailingDots(hostname);
14462
+ let trimmed = trimTrailingDots(hostname);
14463
+ if (trimmed.indexOf(":") !== -1) {
14464
+ try {
14465
+ trimmed = new URL("http://[" + trimmed + "]/").hostname.slice(1, -1);
14466
+ } catch (_err) {
14467
+ return trimmed;
14468
+ }
14469
+ } else if (/[\u0080-\uffff]/.test(trimmed)) {
14470
+ const prefix = /^[*.]+/.exec(trimmed);
14471
+ const start = prefix ? prefix[0] : "";
14472
+ const ascii = domainToASCII(trimmed.slice(start.length));
14473
+ if (!ascii)
14474
+ return "";
14475
+ trimmed = start + trimTrailingDots(ascii);
14476
+ }
14371
14477
  const ipv4 = normalizeIPAddress(trimmed);
14372
14478
  if (ipv4 !== trimmed) {
14373
14479
  return ipv4;
@@ -14497,7 +14603,7 @@ function shouldBypassProxy(location) {
14497
14603
  });
14498
14604
  }
14499
14605
 
14500
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/speedometer.js
14606
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/speedometer.js
14501
14607
  function speedometer(samplesCount, min) {
14502
14608
  samplesCount = samplesCount || 10;
14503
14609
  const bytes = new Array(samplesCount);
@@ -14533,7 +14639,7 @@ function speedometer(samplesCount, min) {
14533
14639
  }
14534
14640
  var speedometer_default = speedometer;
14535
14641
 
14536
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/throttle.js
14642
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/throttle.js
14537
14643
  function throttle(fn, freq) {
14538
14644
  let timestamp = 0;
14539
14645
  let threshold = 1000 / freq;
@@ -14569,7 +14675,7 @@ function throttle(fn, freq) {
14569
14675
  }
14570
14676
  var throttle_default = throttle;
14571
14677
 
14572
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/progressEventReducer.js
14678
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/progressEventReducer.js
14573
14679
  var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
14574
14680
  let bytesNotified = 0;
14575
14681
  const _speedometer = speedometer_default(50, 250);
@@ -14610,7 +14716,7 @@ var progressEventDecorator = (total, throttled) => {
14610
14716
  };
14611
14717
  var asyncDecorator = (fn, scheduler = utils_default.asap) => (...args) => scheduler(() => fn(...args));
14612
14718
 
14613
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
14719
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
14614
14720
  var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
14615
14721
  var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
14616
14722
  var hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55;
@@ -14632,6 +14738,26 @@ var estimateBase64BufferAllocation = (body) => {
14632
14738
  }
14633
14739
  return Math.floor((len - padding) * 3 / 4);
14634
14740
  };
14741
+ var estimatePercentDecodedBase64BufferAllocation = (body) => {
14742
+ if (body.indexOf("%") === -1) {
14743
+ return estimateBase64BufferAllocation(body);
14744
+ }
14745
+ let length = 0;
14746
+ let previous = 0;
14747
+ let last = 0;
14748
+ for (let i = 0, len = body.length;i < len; i++) {
14749
+ let code = body.charCodeAt(i);
14750
+ if (code === 37 && isPercentEncodedByte(body, i, len)) {
14751
+ code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
14752
+ i += 2;
14753
+ }
14754
+ length++;
14755
+ previous = last;
14756
+ last = code;
14757
+ }
14758
+ const padding = last === 61 ? previous === 61 ? 2 : 1 : 0;
14759
+ return Math.floor((length - padding) * 3 / 4);
14760
+ };
14635
14761
  var estimatePercentDecodedBase64Bytes = (body) => {
14636
14762
  const len = body.length;
14637
14763
  let significant = 0;
@@ -14661,17 +14787,17 @@ var estimatePercentDecodedBase64Bytes = (body) => {
14661
14787
  }
14662
14788
  return base64Bytes(significant);
14663
14789
  };
14664
- var estimateDataURLBytes = (url, estimateBase64) => {
14790
+ var estimateDataURLBytes = (url, estimateBase64, base64Pattern) => {
14665
14791
  if (!url || typeof url !== "string")
14666
14792
  return 0;
14667
- if (!url.startsWith("data:"))
14793
+ if (!/^data:/i.test(url))
14668
14794
  return 0;
14669
14795
  const comma = url.indexOf(",");
14670
14796
  if (comma < 0)
14671
14797
  return 0;
14672
14798
  const meta = url.slice(5, comma);
14673
14799
  const body = url.slice(comma + 1);
14674
- const isBase64 = /;base64/i.test(meta);
14800
+ const isBase64 = base64Pattern.test(meta);
14675
14801
  if (isBase64) {
14676
14802
  return estimateBase64(body);
14677
14803
  }
@@ -14701,13 +14827,13 @@ var estimateDataURLBytes = (url, estimateBase64) => {
14701
14827
  };
14702
14828
  function estimateDataURLDecodedBytes(url) {
14703
14829
  const fragmentIndex = typeof url === "string" ? url.indexOf("#") : -1;
14704
- return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes);
14830
+ return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes, /; *base64[\t\n\f\r ]*$/i);
14705
14831
  }
14706
14832
  function estimateDataURLBufferAllocation(url) {
14707
- return estimateDataURLBytes(url, estimateBase64BufferAllocation);
14833
+ return estimateDataURLBytes(url, estimatePercentDecodedBase64BufferAllocation, /;base64$/i);
14708
14834
  }
14709
14835
 
14710
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/http.js
14836
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/http.js
14711
14837
  var zlibOptions = {
14712
14838
  flush: zlib.constants.Z_SYNC_FLUSH,
14713
14839
  finishFlush: zlib.constants.Z_SYNC_FLUSH
@@ -14738,6 +14864,18 @@ function handleSocketError(err) {
14738
14864
  var kAxiosInstalledTunnel = Symbol("axios.http.installedTunnel");
14739
14865
  var tunnelingAgentCache = new Map;
14740
14866
  var tunnelingAgentCacheUser = new WeakMap;
14867
+ var directAgents = new WeakMap;
14868
+ var directAgentHooks = ["createConnection", "getName"];
14869
+ var nativeAgentPoolHooks = [
14870
+ "addRequest",
14871
+ "createSocket",
14872
+ "removeSocket",
14873
+ "keepSocketAlive",
14874
+ "reuseSocket",
14875
+ "_getSession",
14876
+ "_cacheSession",
14877
+ "_evictSession"
14878
+ ];
14741
14879
  var NODE_NATIVE_ENV_PROXY_SUPPORT = {
14742
14880
  22: 21,
14743
14881
  24: 5
@@ -14765,6 +14903,46 @@ function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.
14765
14903
  function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
14766
14904
  return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent;
14767
14905
  }
14906
+ function getDirectAgent(configuredAgent, transport) {
14907
+ if (!process.allowedNodeEnvironmentFlags || !process.allowedNodeEnvironmentFlags.has("--use-env-proxy")) {
14908
+ return configuredAgent;
14909
+ }
14910
+ const agent = configuredAgent || transport.globalAgent;
14911
+ const options = agent && agent.options;
14912
+ if (!(agent instanceof transport.Agent) || agent.protocol !== transport.globalAgent.protocol || !options || !utils_default.hasOwnProp(options, "proxyEnv") || typeof options.proxyEnv !== "object" || options.proxyEnv === null) {
14913
+ return configuredAgent;
14914
+ }
14915
+ for (const hook of nativeAgentPoolHooks) {
14916
+ if (utils_default.isFunction(transport.Agent.prototype[hook]) && agent[hook] !== transport.Agent.prototype[hook]) {
14917
+ throw new AxiosError_default("proxy: false cannot adapt an agent overriding " + hook + "; use an agent constructed without proxyEnv", AxiosError_default.ERR_BAD_OPTION_VALUE);
14918
+ }
14919
+ }
14920
+ let direct = directAgents.get(agent);
14921
+ if (!direct) {
14922
+ direct = new transport.Agent({ ...options, proxyEnv: undefined });
14923
+ const destroy = agent.destroy;
14924
+ agent.destroy = function destroyWithDirectAgent() {
14925
+ try {
14926
+ return destroy.apply(this, arguments);
14927
+ } finally {
14928
+ direct.destroy();
14929
+ }
14930
+ };
14931
+ directAgents.set(agent, direct);
14932
+ }
14933
+ for (const hook of directAgentHooks) {
14934
+ direct[hook] = agent[hook] === transport.Agent.prototype[hook] ? transport.Agent.prototype[hook] : bind(agent[hook], agent);
14935
+ }
14936
+ return direct;
14937
+ }
14938
+ function setDirectAgent(options, configHttpAgent, configHttpsAgent) {
14939
+ const secure = isHttps.test(options.protocol);
14940
+ const agent = getDirectAgent(secure ? configHttpsAgent : configHttpAgent, secure ? https : http);
14941
+ options.agent = agent;
14942
+ if (options.agents) {
14943
+ options.agents[secure ? "https" : "http"] = agent;
14944
+ }
14945
+ }
14768
14946
  function getTunnelingAgent(agentOptions, userHttpsAgent) {
14769
14947
  const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
14770
14948
  const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, new Map).get(userHttpsAgent) : tunnelingAgentCache;
@@ -14773,13 +14951,12 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
14773
14951
  return agent;
14774
14952
  const merged = userHttpsAgent && userHttpsAgent.options ? { ...userHttpsAgent.options, ...agentOptions } : agentOptions;
14775
14953
  agent = new import_https_proxy_agent.default(merged);
14776
- if (userHttpsAgent && userHttpsAgent.options) {
14777
- const originTLSOptions = { ...userHttpsAgent.options };
14778
- const callback = agent.callback;
14779
- agent.callback = function axiosTunnelingAgentCallback(req, opts) {
14780
- return callback.call(this, req, { ...originTLSOptions, ...opts });
14781
- };
14782
- }
14954
+ const callback = agent.callback;
14955
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
14956
+ const originTLSAgent = userHttpsAgent || https.globalAgent;
14957
+ const originTLSOptions = originTLSAgent && originTLSAgent.options;
14958
+ return callback.call(this, req, { ...originTLSOptions, ...opts });
14959
+ };
14783
14960
  agent[kAxiosInstalledTunnel] = true;
14784
14961
  cache.set(key, agent);
14785
14962
  return agent;
@@ -14803,6 +14980,10 @@ var flushOnFinish = (stream, [throttled, flush]) => {
14803
14980
  };
14804
14981
  var http2Sessions = new Http2Sessions_default;
14805
14982
  function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
14983
+ if (!isSameOriginRedirect(options, requestDetails)) {
14984
+ stripMatchingHeaders(options.headers, new Set(["authorization", "cookie"]));
14985
+ delete options.auth;
14986
+ }
14806
14987
  if (options.beforeRedirects.proxy) {
14807
14988
  options.beforeRedirects.proxy(options);
14808
14989
  }
@@ -14812,6 +14993,9 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
14812
14993
  if (options.beforeRedirects.sensitiveHeaders) {
14813
14994
  options.beforeRedirects.sensitiveHeaders(options, requestDetails);
14814
14995
  }
14996
+ if (options.beforeRedirects.direct) {
14997
+ options.beforeRedirects.direct(options);
14998
+ }
14815
14999
  if (options.beforeRedirects.config) {
14816
15000
  options.beforeRedirects.config(options, responseDetails, requestDetails);
14817
15001
  }
@@ -14857,6 +15041,9 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent,
14857
15041
  if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
14858
15042
  options.agent = undefined;
14859
15043
  }
15044
+ if (isRedirect && options.agents && options.agents.https && options.agents.https[kAxiosInstalledTunnel]) {
15045
+ options.agents.https = configHttpsAgent;
15046
+ }
14860
15047
  if (proxy) {
14861
15048
  const isProxyURL = proxy instanceof URL;
14862
15049
  const readProxyField = (key) => isProxyURL || utils_default.hasOwnProp(proxy, key) ? proxy[key] : undefined;
@@ -15027,9 +15214,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
15027
15214
  httpVersion = 1;
15028
15215
  const rawHttpVersion = httpVersion;
15029
15216
  let http2Options = own("http2Options");
15217
+ const configProxy = own("proxy");
15030
15218
  const httpAgent = own("httpAgent");
15031
15219
  const httpsAgent = own("httpsAgent");
15032
- const configProxy = own("proxy");
15033
15220
  const responseType = own("responseType");
15034
15221
  const responseEncoding = own("responseEncoding");
15035
15222
  const socketPath = own("socketPath");
@@ -15141,6 +15328,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
15141
15328
  } catch (err) {
15142
15329
  throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config);
15143
15330
  }
15331
+ if (maxContentLength > -1 && (responseType === "blob" ? convertedData.size : convertedData.length) > maxContentLength) {
15332
+ return reject(new AxiosError_default("maxContentLength size of " + maxContentLength + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config));
15333
+ }
15144
15334
  if (responseType === "text") {
15145
15335
  convertedData = convertedData.toString(responseEncoding);
15146
15336
  if (!responseEncoding || responseEncoding === "utf8") {
@@ -15280,9 +15470,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
15280
15470
  }
15281
15471
  let transport;
15282
15472
  let isNativeTransport = false;
15283
- let transportEnforcesMaxBodyLength = false;
15284
15473
  const isHttpsRequest = isHttps.test(options.protocol);
15285
- if (options.agent == null) {
15474
+ if (!isHttp2 && configProxy === false) {
15475
+ setDirectAgent(options, httpAgent, httpsAgent);
15476
+ options.beforeRedirects.direct = (redirectOptions) => {
15477
+ setDirectAgent(redirectOptions, httpAgent, httpsAgent);
15478
+ };
15479
+ } else if (options.agent == null) {
15286
15480
  options.agent = isHttpsRequest ? httpsAgent : httpAgent;
15287
15481
  }
15288
15482
  if (isHttp2) {
@@ -15298,7 +15492,6 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
15298
15492
  transport = isHttpsRequest ? https : http;
15299
15493
  isNativeTransport = true;
15300
15494
  } else {
15301
- transportEnforcesMaxBodyLength = true;
15302
15495
  options.sensitiveHeaders = [];
15303
15496
  if (maxRedirects) {
15304
15497
  options.maxRedirects = maxRedirects;
@@ -15535,7 +15728,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
15535
15728
  }
15536
15729
  });
15537
15730
  let uploadStream = data;
15538
- if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
15731
+ if (maxBodyLength > -1) {
15539
15732
  const limit = maxBodyLength;
15540
15733
  let bytesSent = 0;
15541
15734
  uploadStream = stream3.pipeline([
@@ -15563,13 +15756,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
15563
15756
  });
15564
15757
  };
15565
15758
 
15566
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/isURLSameOrigin.js
15567
- var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
15568
- url = new URL(url, platform_default.origin);
15569
- return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
15570
- })(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
15571
-
15572
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/cookies.js
15759
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/cookies.js
15760
+ var decodeCookieValue = (value) => {
15761
+ try {
15762
+ return decodeURIComponent(value);
15763
+ } catch (e) {
15764
+ return value;
15765
+ }
15766
+ };
15573
15767
  var cookies_default = platform_default.hasStandardBrowserEnv ? {
15574
15768
  write(name, value, expires, path, domain, secure, sameSite) {
15575
15769
  if (typeof document === "undefined")
@@ -15595,20 +15789,29 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? {
15595
15789
  read(name) {
15596
15790
  if (typeof document === "undefined")
15597
15791
  return null;
15598
- const cookies = document.cookie.split(";");
15792
+ const cookieString = document.cookie;
15793
+ if (!cookieString)
15794
+ return null;
15795
+ const cookies = cookieString.split(";");
15599
15796
  for (let i = 0;i < cookies.length; i++) {
15600
15797
  const cookie = cookies[i].replace(/^\s+/, "");
15601
15798
  const eq = cookie.indexOf("=");
15602
15799
  if (eq !== -1 && cookie.slice(0, eq) === name) {
15603
- try {
15604
- return decodeURIComponent(cookie.slice(eq + 1));
15605
- } catch (e) {
15606
- return cookie.slice(eq + 1);
15607
- }
15800
+ return decodeCookieValue(cookie.slice(eq + 1));
15608
15801
  }
15609
15802
  }
15610
15803
  return null;
15611
15804
  },
15805
+ async readAsync(name) {
15806
+ try {
15807
+ const store = typeof window !== "undefined" && window.cookieStore;
15808
+ if (store && utils_default.isFunction(store.get)) {
15809
+ const cookie = await store.get(name);
15810
+ return cookie ? decodeCookieValue(cookie.value) : null;
15811
+ }
15812
+ } catch (e) {}
15813
+ return this.read(name);
15814
+ },
15612
15815
  remove(name) {
15613
15816
  this.write(name, "", Date.now() - 86400000, "/");
15614
15817
  }
@@ -15617,123 +15820,223 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? {
15617
15820
  read() {
15618
15821
  return null;
15619
15822
  },
15823
+ async readAsync() {
15824
+ return null;
15825
+ },
15620
15826
  remove() {}
15621
15827
  };
15622
15828
 
15623
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/mergeConfig.js
15829
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/isURLSameOrigin.js
15830
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin) => (url) => {
15831
+ url = new URL(url, document.baseURI || platform_default.origin);
15832
+ return origin.protocol === url.protocol && origin.host === url.host && origin.port === url.port;
15833
+ })(new URL(platform_default.origin)) : () => true;
15834
+
15835
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/assertParamsAcyclic.js
15836
+ function assertParamsAcyclic(params) {
15837
+ const pending = [{ value: params }];
15838
+ const active = new WeakSet;
15839
+ const visited = new WeakSet;
15840
+ while (pending.length) {
15841
+ const { value, done } = pending.pop();
15842
+ if (!utils_default.isPlainObject(value) && !utils_default.isArray(value))
15843
+ continue;
15844
+ if (done) {
15845
+ active.delete(value);
15846
+ continue;
15847
+ }
15848
+ if (active.has(value)) {
15849
+ throw new AxiosError_default("Circular reference detected in params", AxiosError_default.ERR_BAD_OPTION_VALUE);
15850
+ }
15851
+ if (visited.has(value))
15852
+ continue;
15853
+ visited.add(value);
15854
+ active.add(value);
15855
+ pending.push({ value, done: true });
15856
+ const keys = Object.keys(value);
15857
+ if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
15858
+ Object.getOwnPropertySymbols(value).forEach((key) => {
15859
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
15860
+ if (descriptor && descriptor.enumerable)
15861
+ keys.push(key);
15862
+ });
15863
+ }
15864
+ keys.forEach((key) => {
15865
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
15866
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
15867
+ if (descriptor && utils_default.hasOwnProp(descriptor, "value")) {
15868
+ pending.push({ value: descriptor.value });
15869
+ }
15870
+ } else {
15871
+ pending.push({ value: value[key] });
15872
+ }
15873
+ });
15874
+ }
15875
+ }
15876
+
15877
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/mergeConfig.js
15624
15878
  var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
15625
15879
  var ownEnumerableKeys = (thing) => {
15626
15880
  if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
15627
- return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter((symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable));
15881
+ return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter((symbol) => {
15882
+ const descriptor = Object.getOwnPropertyDescriptor(thing, symbol);
15883
+ return descriptor && descriptor.enumerable;
15884
+ }));
15628
15885
  }
15629
15886
  return Object.keys(thing);
15630
15887
  };
15631
- function mergeConfig(config1, config2) {
15632
- config1 = config1 || {};
15633
- config2 = config2 || {};
15634
- const config = Object.create(null);
15635
- Object.defineProperty(config, "hasOwnProperty", {
15636
- __proto__: null,
15637
- value: Object.prototype.hasOwnProperty,
15638
- enumerable: false,
15639
- writable: true,
15640
- configurable: true
15641
- });
15642
- function getMergedValue(target, source, prop, caseless) {
15643
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
15644
- return utils_default.merge.call({ caseless }, target, source);
15645
- } else if (utils_default.isPlainObject(source)) {
15646
- return utils_default.merge({}, source);
15647
- } else if (utils_default.isArray(source)) {
15648
- return source.slice();
15649
- }
15650
- return source;
15888
+ function mergeParams(a, b) {
15889
+ const pending = [];
15890
+ const copies = new WeakMap;
15891
+ const empty = {};
15892
+ function copy(target, source) {
15893
+ if (!utils_default.isPlainObject(source)) {
15894
+ return utils_default.isArray(source) ? source.slice() : source;
15895
+ }
15896
+ const base = utils_default.isPlainObject(target) ? target : empty;
15897
+ let bases = copies.get(source);
15898
+ if (!bases) {
15899
+ bases = new WeakMap;
15900
+ copies.set(source, bases);
15901
+ }
15902
+ if (bases.has(base))
15903
+ return bases.get(base);
15904
+ const result = {};
15905
+ bases.set(base, result);
15906
+ pending.push({ base, source, result });
15907
+ return result;
15651
15908
  }
15652
- function mergeDeepProperties(a, b, prop, caseless) {
15653
- if (!utils_default.isUndefined(b)) {
15654
- return getMergedValue(a, b, prop, caseless);
15655
- } else if (!utils_default.isUndefined(a)) {
15656
- return getMergedValue(undefined, a, prop, caseless);
15657
- }
15909
+ const result = utils_default.isUndefined(b) ? copy(undefined, a) : copy(a, b);
15910
+ while (pending.length) {
15911
+ const { base, source, result: target } = pending.pop();
15912
+ const baseKeys = new Set(ownEnumerableKeys(base));
15913
+ const sourceKeys = new Set(ownEnumerableKeys(source));
15914
+ const keys = new Set([...baseKeys, ...sourceKeys]);
15915
+ keys.forEach((key) => {
15916
+ if (key === "__proto__" || key === "constructor" || key === "prototype")
15917
+ return;
15918
+ const hasSource = sourceKeys.has(key);
15919
+ const value = hasSource ? source[key] : undefined;
15920
+ const previous = (!hasSource || utils_default.isPlainObject(value)) && baseKeys.has(key) ? base[key] : undefined;
15921
+ target[key] = hasSource ? copy(previous, value) : copy(undefined, previous);
15922
+ });
15658
15923
  }
15659
- function valueFromConfig2(a, b) {
15660
- if (!utils_default.isUndefined(b)) {
15661
- return getMergedValue(undefined, b);
15662
- }
15924
+ assertParamsAcyclic(result);
15925
+ return result;
15926
+ }
15927
+ function getMergedValue(target, source, prop, caseless) {
15928
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
15929
+ return utils_default.merge.call({ caseless }, target, source);
15930
+ } else if (utils_default.isPlainObject(source)) {
15931
+ return utils_default.merge({}, source);
15932
+ } else if (utils_default.isArray(source)) {
15933
+ return source.slice();
15934
+ }
15935
+ return source;
15936
+ }
15937
+ function mergeDeepProperties(a, b, prop, caseless) {
15938
+ if (!utils_default.isUndefined(b)) {
15939
+ return getMergedValue(a, b, prop, caseless);
15940
+ } else if (!utils_default.isUndefined(a)) {
15941
+ return getMergedValue(undefined, a, prop, caseless);
15663
15942
  }
15664
- function defaultToConfig2(a, b) {
15665
- if (!utils_default.isUndefined(b)) {
15666
- return getMergedValue(undefined, b);
15667
- } else if (!utils_default.isUndefined(a)) {
15668
- return getMergedValue(undefined, a);
15669
- }
15943
+ }
15944
+ function valueFromConfig2(a, b) {
15945
+ if (!utils_default.isUndefined(b)) {
15946
+ return getMergedValue(undefined, b);
15670
15947
  }
15671
- function getMergedTransitionalOption(prop) {
15672
- const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : undefined;
15673
- if (!utils_default.isUndefined(transitional2)) {
15674
- if (utils_default.isPlainObject(transitional2)) {
15675
- if (utils_default.hasOwnProp(transitional2, prop)) {
15676
- return transitional2[prop];
15677
- }
15678
- } else {
15679
- return;
15948
+ }
15949
+ function defaultToConfig2(a, b) {
15950
+ if (!utils_default.isUndefined(b)) {
15951
+ return getMergedValue(undefined, b);
15952
+ } else if (!utils_default.isUndefined(a)) {
15953
+ return getMergedValue(undefined, a);
15954
+ }
15955
+ }
15956
+ function getMergedTransitionalOption(config1, config2, prop) {
15957
+ const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : undefined;
15958
+ if (!utils_default.isUndefined(transitional2)) {
15959
+ if (utils_default.isPlainObject(transitional2)) {
15960
+ if (utils_default.hasOwnProp(transitional2, prop)) {
15961
+ return transitional2[prop];
15680
15962
  }
15963
+ } else {
15964
+ return;
15681
15965
  }
15682
- const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : undefined;
15683
- if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) {
15684
- return transitional1[prop];
15685
- }
15686
- return;
15687
15966
  }
15688
- function mergeDirectKeys(a, b, prop) {
15689
- if (utils_default.hasOwnProp(config2, prop)) {
15690
- return getMergedValue(a, b);
15691
- } else if (utils_default.hasOwnProp(config1, prop)) {
15692
- return getMergedValue(undefined, a);
15693
- }
15694
- }
15695
- const mergeMap = {
15696
- url: valueFromConfig2,
15697
- method: valueFromConfig2,
15698
- data: valueFromConfig2,
15699
- baseURL: defaultToConfig2,
15700
- transformRequest: defaultToConfig2,
15701
- transformResponse: defaultToConfig2,
15702
- paramsSerializer: defaultToConfig2,
15703
- timeout: defaultToConfig2,
15704
- timeoutErrorMessage: defaultToConfig2,
15705
- withCredentials: defaultToConfig2,
15706
- withXSRFToken: defaultToConfig2,
15707
- adapter: defaultToConfig2,
15708
- responseType: defaultToConfig2,
15709
- xsrfCookieName: defaultToConfig2,
15710
- xsrfHeaderName: defaultToConfig2,
15711
- onUploadProgress: defaultToConfig2,
15712
- onDownloadProgress: defaultToConfig2,
15713
- decompress: defaultToConfig2,
15714
- maxContentLength: defaultToConfig2,
15715
- maxBodyLength: defaultToConfig2,
15716
- beforeRedirect: defaultToConfig2,
15717
- transport: defaultToConfig2,
15718
- httpAgent: defaultToConfig2,
15719
- httpsAgent: defaultToConfig2,
15720
- cancelToken: defaultToConfig2,
15721
- socketPath: defaultToConfig2,
15722
- allowedSocketPaths: defaultToConfig2,
15723
- responseEncoding: defaultToConfig2,
15724
- validateStatus: mergeDirectKeys,
15725
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
15726
- };
15727
- utils_default.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {
15967
+ const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : undefined;
15968
+ if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) {
15969
+ return transitional1[prop];
15970
+ }
15971
+ return;
15972
+ }
15973
+ function mergeDirectKeys(a, b, prop, config1, config2) {
15974
+ if (utils_default.hasOwnProp(config2, prop)) {
15975
+ return getMergedValue(a, b);
15976
+ } else if (utils_default.hasOwnProp(config1, prop)) {
15977
+ return getMergedValue(undefined, a);
15978
+ }
15979
+ }
15980
+ function mergeHeaders(a, b, prop) {
15981
+ return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
15982
+ }
15983
+ var hasOwnPropertyDescriptor = Object.freeze({
15984
+ __proto__: null,
15985
+ value: Object.prototype.hasOwnProperty,
15986
+ enumerable: false,
15987
+ writable: true,
15988
+ configurable: true
15989
+ });
15990
+ var mergeMap = {
15991
+ url: valueFromConfig2,
15992
+ method: valueFromConfig2,
15993
+ data: valueFromConfig2,
15994
+ baseURL: defaultToConfig2,
15995
+ transformRequest: defaultToConfig2,
15996
+ transformResponse: defaultToConfig2,
15997
+ params: mergeParams,
15998
+ paramsSerializer: defaultToConfig2,
15999
+ timeout: defaultToConfig2,
16000
+ timeoutErrorMessage: defaultToConfig2,
16001
+ withCredentials: defaultToConfig2,
16002
+ withXSRFToken: defaultToConfig2,
16003
+ adapter: defaultToConfig2,
16004
+ responseType: defaultToConfig2,
16005
+ xsrfCookieName: defaultToConfig2,
16006
+ xsrfHeaderName: defaultToConfig2,
16007
+ onUploadProgress: defaultToConfig2,
16008
+ onDownloadProgress: defaultToConfig2,
16009
+ decompress: defaultToConfig2,
16010
+ maxContentLength: defaultToConfig2,
16011
+ maxBodyLength: defaultToConfig2,
16012
+ beforeRedirect: defaultToConfig2,
16013
+ transport: defaultToConfig2,
16014
+ httpAgent: defaultToConfig2,
16015
+ httpsAgent: defaultToConfig2,
16016
+ cancelToken: defaultToConfig2,
16017
+ socketPath: defaultToConfig2,
16018
+ allowedSocketPaths: defaultToConfig2,
16019
+ responseEncoding: defaultToConfig2,
16020
+ validateStatus: mergeDirectKeys,
16021
+ headers: mergeHeaders
16022
+ };
16023
+ function mergeConfig(config1, config2) {
16024
+ config1 = config1 || {};
16025
+ config2 = config2 || {};
16026
+ const config = Object.create(null);
16027
+ Object.defineProperty(config, "hasOwnProperty", hasOwnPropertyDescriptor);
16028
+ const keys = ownEnumerableKeys({ ...config1, ...config2 });
16029
+ for (let i = 0, len = keys.length;i < len; i++) {
16030
+ const prop = keys[i];
15728
16031
  if (prop === "__proto__" || prop === "constructor" || prop === "prototype")
15729
- return;
16032
+ continue;
15730
16033
  const merge = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
15731
16034
  const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : undefined;
15732
16035
  const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : undefined;
15733
- const configValue = merge(a, b, prop);
16036
+ const configValue = merge === mergeDirectKeys ? merge(a, b, prop, config1, config2) : merge(a, b, prop);
15734
16037
  utils_default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
15735
- });
15736
- if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) {
16038
+ }
16039
+ if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption(config1, config2, "validateStatusUndefinedResolves") === false) {
15737
16040
  if (utils_default.hasOwnProp(config1, "validateStatus")) {
15738
16041
  config.validateStatus = getMergedValue(undefined, config1.validateStatus);
15739
16042
  } else {
@@ -15743,9 +16046,10 @@ function mergeConfig(config1, config2) {
15743
16046
  return config;
15744
16047
  }
15745
16048
 
15746
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/resolveConfig.js
16049
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/resolveConfig.js
15747
16050
  var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
15748
- function resolveConfig(config) {
16051
+ var readCookie = (name) => cookies_default.read(name);
16052
+ function resolveConfig(config, readXsrfCookie = readCookie) {
15749
16053
  const newConfig = mergeConfig({}, config);
15750
16054
  const own = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
15751
16055
  const data = own("data");
@@ -15762,8 +16066,10 @@ function resolveConfig(config) {
15762
16066
  if (auth) {
15763
16067
  const username = utils_default.getSafeProp(auth, "username") || "";
15764
16068
  const password = utils_default.getSafeProp(auth, "password") || "";
16069
+ const transitional = own("transitional");
16070
+ const encodeUsername = transitional && utils_default.hasOwnProp(transitional, "encodeBasicAuthUsername") && transitional.encodeBasicAuthUsername === true;
15765
16071
  try {
15766
- headers.set("Authorization", "Basic " + btoa(username + ":" + (password ? encodeUTF8(password) : "")));
16072
+ headers.set("Authorization", "Basic " + btoa((encodeUsername ? encodeUTF8(username) : username) + ":" + (password ? encodeUTF8(password) : "")));
15767
16073
  } catch (e) {
15768
16074
  throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_OPTION_VALUE, config);
15769
16075
  }
@@ -15782,7 +16088,7 @@ function resolveConfig(config) {
15782
16088
  }
15783
16089
  const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url);
15784
16090
  if (shouldSendXSRF) {
15785
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
16091
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
15786
16092
  if (xsrfValue) {
15787
16093
  headers.set(xsrfHeaderName, xsrfValue);
15788
16094
  }
@@ -15792,20 +16098,50 @@ function resolveConfig(config) {
15792
16098
  }
15793
16099
  var resolveConfig_default = resolveConfig;
15794
16100
 
15795
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/xhr.js
16101
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/xhr.js
15796
16102
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
15797
16103
  var xhr_default = isXHRAdapterSupported && function(config) {
15798
16104
  return new Promise(function dispatchXhrRequest(resolve, reject) {
15799
- const _config = resolveConfig_default(config);
16105
+ let useAsyncXsrf;
16106
+ try {
16107
+ const store = platform_default.hasStandardBrowserEnv && typeof window !== "undefined" && window.cookieStore;
16108
+ useAsyncXsrf = store && utils_default.isFunction(store.get);
16109
+ } catch (e) {}
16110
+ let xsrfCookieName;
16111
+ const _config = resolveConfig_default(config, useAsyncXsrf ? (name) => {
16112
+ xsrfCookieName = name;
16113
+ return null;
16114
+ } : undefined);
15800
16115
  let requestData = _config.data;
15801
16116
  const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
15802
16117
  let { responseType, onUploadProgress, onDownloadProgress } = _config;
15803
16118
  let onCanceled;
16119
+ let timeoutId;
15804
16120
  let uploadThrottled, downloadThrottled;
15805
16121
  let flushUpload, flushDownload, flushDownloadWithEvent;
15806
16122
  function done() {
15807
- flushUpload && flushUpload();
15808
- flushDownload && flushDownload();
16123
+ clearTimeout(timeoutId);
16124
+ try {
16125
+ flushUpload && flushUpload();
16126
+ } catch (err) {
16127
+ setTimeout(() => {
16128
+ throw err;
16129
+ });
16130
+ }
16131
+ try {
16132
+ flushDownload && flushDownload();
16133
+ } catch (err) {
16134
+ setTimeout(() => {
16135
+ throw err;
16136
+ });
16137
+ }
16138
+ if (request) {
16139
+ downloadThrottled && request.removeEventListener("progress", downloadThrottled);
16140
+ if (request.upload) {
16141
+ uploadThrottled && request.upload.removeEventListener("progress", uploadThrottled);
16142
+ flushUpload && request.upload.removeEventListener("loadend", flushUpload);
16143
+ }
16144
+ }
15809
16145
  _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
15810
16146
  _config.signal && _config.signal.removeEventListener("abort", onCanceled);
15811
16147
  }
@@ -15885,6 +16221,8 @@ var xhr_default = isXHRAdapterSupported && function(config) {
15885
16221
  request = null;
15886
16222
  };
15887
16223
  request.ontimeout = function handleTimeout() {
16224
+ if (!request)
16225
+ return;
15888
16226
  let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
15889
16227
  const transitional = _config.transitional || transitional_default;
15890
16228
  if (_config.timeoutErrorMessage) {
@@ -15895,11 +16233,6 @@ var xhr_default = isXHRAdapterSupported && function(config) {
15895
16233
  request = null;
15896
16234
  };
15897
16235
  requestData === undefined && requestHeaders.setContentType(null);
15898
- if ("setRequestHeader" in request) {
15899
- utils_default.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
15900
- request.setRequestHeader(key, val);
15901
- });
15902
- }
15903
16236
  if (!utils_default.isUndefined(_config.withCredentials)) {
15904
16237
  request.withCredentials = !!_config.withCredentials;
15905
16238
  }
@@ -15921,26 +16254,83 @@ var xhr_default = isXHRAdapterSupported && function(config) {
15921
16254
  return;
15922
16255
  }
15923
16256
  reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
15924
- request.abort();
16257
+ const xhr = request;
15925
16258
  done();
15926
16259
  request = null;
16260
+ xhr.abort();
15927
16261
  };
15928
16262
  _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
16263
+ if (!request)
16264
+ return;
15929
16265
  if (_config.signal) {
15930
16266
  _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
15931
16267
  }
15932
16268
  }
16269
+ if (!request)
16270
+ return;
15933
16271
  const protocol = parseProtocol(_config.url);
15934
16272
  if (protocol && !platform_default.protocols.includes(protocol)) {
15935
16273
  reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
15936
16274
  done();
15937
16275
  return;
15938
16276
  }
15939
- request.send(requestData || null);
16277
+ const sendRequest = () => {
16278
+ if (!request)
16279
+ return;
16280
+ if ("setRequestHeader" in request) {
16281
+ utils_default.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
16282
+ request.setRequestHeader(key, val);
16283
+ });
16284
+ }
16285
+ request.send(requestData || null);
16286
+ };
16287
+ if (xsrfCookieName) {
16288
+ const now = typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
16289
+ const deadline = request.timeout > 0 ? now() + Number(request.timeout) : undefined;
16290
+ const abortOnTimeout = () => {
16291
+ if (!request)
16292
+ return;
16293
+ const xhr = request;
16294
+ xhr.ontimeout();
16295
+ xhr.abort();
16296
+ };
16297
+ if (deadline !== undefined) {
16298
+ const scheduleTimeout = () => {
16299
+ const remaining = deadline - now();
16300
+ if (remaining > 0) {
16301
+ timeoutId = setTimeout(scheduleTimeout, Math.min(remaining, 2147483647));
16302
+ } else {
16303
+ abortOnTimeout();
16304
+ }
16305
+ };
16306
+ scheduleTimeout();
16307
+ }
16308
+ cookies_default.readAsync(xsrfCookieName).then((value) => {
16309
+ if (!request)
16310
+ return;
16311
+ if (deadline !== undefined && now() >= deadline) {
16312
+ abortOnTimeout();
16313
+ return;
16314
+ }
16315
+ if (value) {
16316
+ const headerName = utils_default.hasOwnProp(_config, "xsrfHeaderName") && _config.xsrfHeaderName;
16317
+ requestHeaders.set(headerName, value);
16318
+ }
16319
+ sendRequest();
16320
+ }).catch((error) => {
16321
+ if (!request)
16322
+ return;
16323
+ reject(AxiosError_default.from(error, null, config, request));
16324
+ done();
16325
+ request = null;
16326
+ });
16327
+ } else {
16328
+ sendRequest();
16329
+ }
15940
16330
  });
15941
16331
  };
15942
16332
 
15943
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/composeSignals.js
16333
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/composeSignals.js
15944
16334
  var composeSignals = (signals, timeout) => {
15945
16335
  signals = signals ? signals.filter(Boolean) : [];
15946
16336
  if (!timeout && !signals.length) {
@@ -15967,7 +16357,8 @@ var composeSignals = (signals, timeout) => {
15967
16357
  timer && clearTimeout(timer);
15968
16358
  timer = null;
15969
16359
  signals.forEach((signal) => {
15970
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener("abort", onabort);
16360
+ const unsubscribeSignal = utils_default.getSafeProp(signal, "unsubscribe");
16361
+ utils_default.isFunction(unsubscribeSignal) ? unsubscribeSignal.call(signal, onabort) : signal.removeEventListener("abort", onabort);
15971
16362
  });
15972
16363
  signals = null;
15973
16364
  };
@@ -15987,7 +16378,7 @@ var composeSignals = (signals, timeout) => {
15987
16378
  };
15988
16379
  var composeSignals_default = composeSignals;
15989
16380
 
15990
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/trackStream.js
16381
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/trackStream.js
15991
16382
  var streamChunk = function* (chunk, chunkSize) {
15992
16383
  let len = chunk.byteLength;
15993
16384
  if (!chunkSize || len < chunkSize) {
@@ -16064,7 +16455,111 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
16064
16455
  });
16065
16456
  };
16066
16457
 
16067
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/fetch.js
16458
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/formDataToBlob.js
16459
+ var CRLF2 = `\r
16460
+ `;
16461
+ var normalizeLines = (value) => String(value).replace(/\r\n|\r|\n/g, CRLF2);
16462
+ var escapeName = (value) => String(value).replace(/[\r\n"]/g, (char) => char === "\r" ? "%0D" : char === `
16463
+ ` ? "%0A" : "%22");
16464
+ var stringBytes = (value, normalize) => {
16465
+ let length = 0;
16466
+ for (let i = 0;i < value.length; i++) {
16467
+ const code = value.charCodeAt(i);
16468
+ if (normalize && (code === 13 || code === 10)) {
16469
+ if (code === 13 && value.charCodeAt(i + 1) === 10)
16470
+ i++;
16471
+ length += 2;
16472
+ } else if (code < 128) {
16473
+ length++;
16474
+ } else if (code < 2048) {
16475
+ length += 2;
16476
+ } else if (code >= 55296 && code <= 56319 && value.charCodeAt(i + 1) >= 56320 && value.charCodeAt(i + 1) <= 57343) {
16477
+ length += 4;
16478
+ i++;
16479
+ } else {
16480
+ length += 3;
16481
+ }
16482
+ }
16483
+ return length;
16484
+ };
16485
+
16486
+ class FormDataError extends TypeError {
16487
+ constructor(message, reason) {
16488
+ super(message);
16489
+ this.name = "FormDataError";
16490
+ this.reason = reason;
16491
+ }
16492
+ }
16493
+ function formDataToBlob(form, Blob2, limit, limitError, boundary) {
16494
+ if (!utils_default.isFunction(Blob2)) {
16495
+ throw new FormDataError("Blob is not supported", "blob");
16496
+ }
16497
+ if (!utils_default.isString(boundary) || !/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(boundary) || / $/.test(boundary)) {
16498
+ throw new FormDataError("Invalid multipart boundary", "boundary");
16499
+ }
16500
+ const footer = "--" + boundary + "--" + CRLF2;
16501
+ let length = footer.length;
16502
+ const parts = [];
16503
+ const checkLength = (extra) => {
16504
+ if (length + extra > limit)
16505
+ throw limitError();
16506
+ };
16507
+ checkLength(0);
16508
+ for (const [name, value] of form) {
16509
+ const isString = utils_default.isString(value);
16510
+ const valueLength = isString ? stringBytes(value, true) : value.size;
16511
+ if (!Number.isFinite(valueLength) || valueLength < 0) {
16512
+ throw new FormDataError("Unsupported FormData part size", "part");
16513
+ }
16514
+ checkLength(valueLength + stringBytes(name, true) + (!isString && value.name ? stringBytes(value.name, false) : 0) + (!isString && value.type ? stringBytes(value.type, false) : 0));
16515
+ let header = "--" + boundary + CRLF2 + 'Content-Disposition: form-data; name="' + escapeName(normalizeLines(name)) + '"';
16516
+ if (!isString) {
16517
+ header += '; filename="' + escapeName(utils_default.isString(value.name) ? value.name : "blob") + '"' + CRLF2 + "Content-Type: " + String(value.type || "application/octet-stream").replace(/[\r\n]/g, "");
16518
+ }
16519
+ header += CRLF2 + CRLF2;
16520
+ const partLength = stringBytes(header, false) + valueLength + CRLF2.length;
16521
+ checkLength(partLength);
16522
+ length += partLength;
16523
+ parts.push({ header, value, isString });
16524
+ }
16525
+ const blobParts = [];
16526
+ for (const part of parts) {
16527
+ blobParts.push(part.header, part.isString ? normalizeLines(part.value) : part.value, CRLF2);
16528
+ }
16529
+ blobParts.push(footer);
16530
+ return new Blob2(blobParts, { type: "multipart/form-data; boundary=" + boundary });
16531
+ }
16532
+
16533
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/createMultipartBody.js
16534
+ function createMultipartBody(form, Blob2, limit, limitError, boundary) {
16535
+ if (!utils_default.isFunction(Blob2)) {
16536
+ throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
16537
+ }
16538
+ if (boundary === undefined) {
16539
+ if (utils_default.isFunction(platform_default.generateString)) {
16540
+ boundary = "axios-" + platform_default.generateString(36, "0123456789abcdef");
16541
+ } else {
16542
+ const crypto = utils_default.global.crypto;
16543
+ if (!crypto || !utils_default.isFunction(crypto.getRandomValues)) {
16544
+ throw new AxiosError_default("Random byte generation is not supported", AxiosError_default.ERR_NOT_SUPPORT);
16545
+ }
16546
+ const random = new Uint8Array(18);
16547
+ crypto.getRandomValues(random);
16548
+ boundary = "axios-" + Array.from(random, (value) => ("0" + value.toString(16)).slice(-2)).join("");
16549
+ }
16550
+ }
16551
+ try {
16552
+ return formDataToBlob(form, Blob2, limit, limitError, boundary);
16553
+ } catch (error) {
16554
+ if (error instanceof FormDataError) {
16555
+ const code = error.reason === "boundary" ? AxiosError_default.ERR_BAD_OPTION_VALUE : AxiosError_default.ERR_BAD_REQUEST;
16556
+ throw new AxiosError_default(error.message, code);
16557
+ }
16558
+ throw error;
16559
+ }
16560
+ }
16561
+
16562
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/fetch.js
16068
16563
  var DEFAULT_CHUNK_SIZE = 64 * 1024;
16069
16564
  var DEFAULT_REQUEST_OPTIONS = {
16070
16565
  cache: "default",
@@ -16111,9 +16606,11 @@ var factory = (env) => {
16111
16606
  skipUndefined: true
16112
16607
  }, {
16113
16608
  Request: globalObject.Request,
16114
- Response: globalObject.Response
16609
+ Response: globalObject.Response,
16610
+ Blob: globalObject.Blob
16115
16611
  }, env);
16116
- const { fetch: envFetch, Request, Response } = env;
16612
+ const envFetch = utils_default.hasOwnProp(env, "fetch") ? env.fetch : undefined;
16613
+ const { Request, Response, Blob: Blob2 } = env;
16117
16614
  const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
16118
16615
  const isRequestSupported = isFunction2(Request);
16119
16616
  const isResponseSupported = isFunction2(Response);
@@ -16139,6 +16636,13 @@ var factory = (env) => {
16139
16636
  return duplexAccessed && !hasContentType;
16140
16637
  });
16141
16638
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
16639
+ const requestDefaults = Object.assign(Object.create(null), DEFAULT_REQUEST_OPTIONS);
16640
+ if (isRequestSupported && !test(() => new Request(platform_default.origin, requestDefaults))) {
16641
+ delete requestDefaults.cache;
16642
+ if (!test(() => new Request(platform_default.origin, requestDefaults))) {
16643
+ requestDefaults.cache = DEFAULT_REQUEST_OPTIONS.cache;
16644
+ }
16645
+ }
16142
16646
  const resolvers = {
16143
16647
  stream: supportsResponseStream && ((res) => res.body)
16144
16648
  };
@@ -16160,13 +16664,6 @@ var factory = (env) => {
16160
16664
  if (utils_default.isBlob(body)) {
16161
16665
  return body.size;
16162
16666
  }
16163
- if (utils_default.isSpecCompliantForm(body)) {
16164
- const _request = new Request(platform_default.origin, {
16165
- method: "POST",
16166
- body
16167
- });
16168
- return (await _request.arrayBuffer()).byteLength;
16169
- }
16170
16667
  if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
16171
16668
  return body.byteLength;
16172
16669
  }
@@ -16211,6 +16708,7 @@ var factory = (env) => {
16211
16708
  });
16212
16709
  let requestContentLength;
16213
16710
  let pendingBodyError = null;
16711
+ let pendingResponseError = null;
16214
16712
  const maxBodyLengthError = () => new AxiosError_default("Request body larger than maxBodyLength limit", AxiosError_default.ERR_BAD_REQUEST, config, request);
16215
16713
  try {
16216
16714
  let auth = undefined;
@@ -16223,8 +16721,9 @@ var factory = (env) => {
16223
16721
  password
16224
16722
  };
16225
16723
  }
16724
+ let parsedURL;
16226
16725
  if (maybeWithAuthCredentials(url)) {
16227
- const parsedURL = new URL(url, platform_default.origin);
16726
+ parsedURL = new URL(url, platform_default.origin);
16228
16727
  if (!auth && (parsedURL.username || parsedURL.password)) {
16229
16728
  const urlUsername = decodeURIComponentSafe2(parsedURL.username);
16230
16729
  const urlPassword = decodeURIComponentSafe2(parsedURL.password);
@@ -16243,12 +16742,24 @@ var factory = (env) => {
16243
16742
  headers.delete("authorization");
16244
16743
  headers.set("Authorization", "Basic " + btoa(encodeUTF82((auth.username || "") + ":" + (auth.password || ""))));
16245
16744
  }
16246
- if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) {
16247
- const estimated = estimateDataURLDecodedBytes(url);
16745
+ if (hasMaxContentLength && parsedURL && parsedURL.protocol === "data:") {
16746
+ const estimated = estimateDataURLDecodedBytes(parsedURL.href);
16248
16747
  if (estimated > maxContentLength) {
16249
16748
  throw new AxiosError_default("maxContentLength size of " + maxContentLength + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config, request);
16250
16749
  }
16251
16750
  }
16751
+ const formContentType = utils_default.isSpecCompliantForm(data) && AxiosHeaders_default.from(own("headers")).getContentType();
16752
+ let formBoundary;
16753
+ if (utils_default.isString(formContentType) && /^multipart\/form-data(?:\s*;|$)/i.test(formContentType.trim())) {
16754
+ const parameters = AxiosHeaders_default.parseParameters(formContentType);
16755
+ if (utils_default.hasOwnProp(parameters, "boundary"))
16756
+ formBoundary = parameters.boundary;
16757
+ }
16758
+ if (utils_default.isSpecCompliantForm(data) && method !== "get" && method !== "head" && (hasMaxBodyLength || onUploadProgress && supportsRequestStream || formBoundary !== undefined)) {
16759
+ data = createMultipartBody(data, Blob2, hasMaxBodyLength ? maxBodyLength : Infinity, maxBodyLengthError, formBoundary);
16760
+ headers.setContentType(formBoundary === undefined ? data.type : formContentType);
16761
+ requestContentLength = data.size;
16762
+ }
16252
16763
  if (hasMaxBodyLength && method !== "get" && method !== "head") {
16253
16764
  const outboundLength = await getBodyLength(data);
16254
16765
  if (typeof outboundLength === "number" && isFinite(outboundLength)) {
@@ -16316,7 +16827,7 @@ var factory = (env) => {
16316
16827
  credentials: isCredentialsSupported ? withCredentials : undefined
16317
16828
  });
16318
16829
  if (isRequestSupported) {
16319
- utils_default.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {
16830
+ utils_default.forEach(requestDefaults, (value, key) => {
16320
16831
  if (resolvedOptions[key] === undefined) {
16321
16832
  resolvedOptions[key] = value;
16322
16833
  }
@@ -16356,7 +16867,7 @@ var factory = (env) => {
16356
16867
  if (hasMaxContentLength) {
16357
16868
  bytesRead = loadedBytes;
16358
16869
  if (bytesRead > maxContentLength) {
16359
- throw new AxiosError_default("maxContentLength size of " + maxContentLength + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config, request);
16870
+ throw pendingResponseError = new AxiosError_default("maxContentLength size of " + maxContentLength + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config, request);
16360
16871
  }
16361
16872
  }
16362
16873
  onProgress && onProgress(loadedBytes);
@@ -16415,6 +16926,9 @@ var factory = (env) => {
16415
16926
  request && !pendingBodyError.request && (pendingBodyError.request = request);
16416
16927
  throw pendingBodyError;
16417
16928
  }
16929
+ if (pendingResponseError) {
16930
+ throw pendingResponseError;
16931
+ }
16418
16932
  if (err instanceof AxiosError_default) {
16419
16933
  request && !err.request && (err.request = request);
16420
16934
  throw err;
@@ -16436,9 +16950,15 @@ var factory = (env) => {
16436
16950
  };
16437
16951
  var seedCache = new Map;
16438
16952
  var getFetch = (config) => {
16439
- let env = config && config.env || {};
16440
- const { fetch: fetch2, Request, Response } = env;
16441
- const seeds = [Request, Response, fetch2];
16953
+ const env = Object.create(null);
16954
+ const configuredEnv = config && utils_default.hasOwnProp(config, "env") && config.env;
16955
+ ["fetch", "Request", "Response", "Blob"].forEach((key) => {
16956
+ if (configuredEnv && utils_default.hasOwnProp(configuredEnv, key)) {
16957
+ env[key] = configuredEnv[key];
16958
+ }
16959
+ });
16960
+ const { fetch: fetch2, Request, Response, Blob: Blob2 } = env;
16961
+ const seeds = [Request, Response, fetch2, Blob2];
16442
16962
  let len = seeds.length, i = len, seed, target, map = seedCache;
16443
16963
  while (i--) {
16444
16964
  seed = seeds[i];
@@ -16450,7 +16970,7 @@ var getFetch = (config) => {
16450
16970
  };
16451
16971
  var adapter = getFetch();
16452
16972
 
16453
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/adapters/adapters.js
16973
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/adapters/adapters.js
16454
16974
  var knownAdapters = {
16455
16975
  http: http_default,
16456
16976
  xhr: xhr_default,
@@ -16503,7 +17023,7 @@ var adapters_default = {
16503
17023
  adapters: knownAdapters
16504
17024
  };
16505
17025
 
16506
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/dispatchRequest.js
17026
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/dispatchRequest.js
16507
17027
  function throwIfCancellationRequested(config) {
16508
17028
  if (config.cancelToken) {
16509
17029
  config.cancelToken.throwIfRequested();
@@ -16512,6 +17032,12 @@ function throwIfCancellationRequested(config) {
16512
17032
  throw new CanceledError_default(null, config);
16513
17033
  }
16514
17034
  }
17035
+ function resolveClock() {
17036
+ return typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
17037
+ }
17038
+ function elapsedSince(now, start) {
17039
+ return Math.max(0, Math.round(now() - start));
17040
+ }
16515
17041
  function dispatchRequest(_config) {
16516
17042
  const config = utils_default.toSafeFlatObject(_config);
16517
17043
  throwIfCancellationRequested(config);
@@ -16521,8 +17047,11 @@ function dispatchRequest(_config) {
16521
17047
  config.headers.setContentType("application/x-www-form-urlencoded", false);
16522
17048
  }
16523
17049
  const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
17050
+ const now = resolveClock();
17051
+ const start = now();
16524
17052
  return adapter(config).then(function onAdapterResolution(response) {
16525
17053
  throwIfCancellationRequested(config);
17054
+ response.duration = elapsedSince(now, start);
16526
17055
  config.response = response;
16527
17056
  try {
16528
17057
  response.data = transformData.call(config, config.transformResponse, response);
@@ -16535,6 +17064,7 @@ function dispatchRequest(_config) {
16535
17064
  if (!isCancel(reason)) {
16536
17065
  throwIfCancellationRequested(config);
16537
17066
  if (reason && reason.response) {
17067
+ reason.response.duration = elapsedSince(now, start);
16538
17068
  config.response = reason.response;
16539
17069
  try {
16540
17070
  reason.response.data = transformData.call(config, config.transformResponse, reason.response);
@@ -16548,7 +17078,7 @@ function dispatchRequest(_config) {
16548
17078
  });
16549
17079
  }
16550
17080
 
16551
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/validator.js
17081
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/validator.js
16552
17082
  var validators = {};
16553
17083
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
16554
17084
  validators[type] = function validator(thing) {
@@ -16604,8 +17134,29 @@ var validator_default = {
16604
17134
  validators
16605
17135
  };
16606
17136
 
16607
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/core/Axios.js
17137
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/core/Axios.js
16608
17138
  var validators2 = validator_default.validators;
17139
+ var isHeadersBucket = (value) => {
17140
+ if (value == null || utils_default.isPlainObject(value) || value instanceof AxiosHeaders_default) {
17141
+ return true;
17142
+ }
17143
+ try {
17144
+ return utils_default.isObject(value) && utils_default.getSafeProp(value, Symbol.toStringTag) === "AxiosHeaders" && [
17145
+ "toJSON",
17146
+ "set",
17147
+ "get",
17148
+ "has",
17149
+ "delete",
17150
+ "clear",
17151
+ "normalize",
17152
+ "concat",
17153
+ "toString",
17154
+ Symbol.iterator
17155
+ ].every((method) => utils_default.isFunction(utils_default.getSafeProp(value, method)));
17156
+ } catch (e) {
17157
+ return false;
17158
+ }
17159
+ };
16609
17160
 
16610
17161
  class Axios {
16611
17162
  constructor(instanceConfig) {
@@ -16637,10 +17188,14 @@ class Axios {
16637
17188
  `);
16638
17189
  const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf(`
16639
17190
  `, firstNewlineIndex + 1);
16640
- const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
16641
- if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
16642
- err.stack += `
16643
- ` + stack;
17191
+ const duplicateCheckSuffix = secondNewlineIndex === -1 ? stack : stack.slice(secondNewlineIndex + 1);
17192
+ const currentStack = String(err.stack);
17193
+ const causeIndex = getCauseStackIndex(err, currentStack);
17194
+ const stackHead = causeIndex === -1 ? currentStack : currentStack.slice(0, causeIndex);
17195
+ const causeSection = causeIndex === -1 ? "" : currentStack.slice(causeIndex);
17196
+ if (!stackHead.endsWith(duplicateCheckSuffix)) {
17197
+ err.stack = stackHead + `
17198
+ ` + stack + causeSection;
16644
17199
  }
16645
17200
  }
16646
17201
  } catch (e) {}
@@ -16664,7 +17219,8 @@ class Axios {
16664
17219
  clarifyTimeoutError: validators2.transitional(validators2.boolean),
16665
17220
  legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean),
16666
17221
  advertiseZstdAcceptEncoding: validators2.transitional(validators2.boolean),
16667
- validateStatusUndefinedResolves: validators2.transitional(validators2.boolean)
17222
+ validateStatusUndefinedResolves: validators2.transitional(validators2.boolean),
17223
+ encodeBasicAuthUsername: validators2.transitional(validators2.boolean)
16668
17224
  }, false);
16669
17225
  }
16670
17226
  if (paramsSerializer != null) {
@@ -16679,7 +17235,7 @@ class Axios {
16679
17235
  }, true);
16680
17236
  }
16681
17237
  }
16682
- if (config.allowAbsoluteUrls !== undefined) {} else if (this.defaults.allowAbsoluteUrls !== undefined) {
17238
+ if (config.allowAbsoluteUrls !== undefined) {} else if (utils_default.hasOwnProp(this.defaults, "allowAbsoluteUrls") && this.defaults.allowAbsoluteUrls !== undefined) {
16683
17239
  config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
16684
17240
  } else {
16685
17241
  config.allowAbsoluteUrls = true;
@@ -16689,9 +17245,13 @@ class Axios {
16689
17245
  withXsrfToken: validators2.spelling("withXSRFToken")
16690
17246
  }, true);
16691
17247
  config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase();
16692
- let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
17248
+ const commonHeaders = utils_default.getSafeProp(headers, "common");
17249
+ const methodHeaders = utils_default.getSafeProp(headers, config.method);
17250
+ const contextHeaders = headers && utils_default.merge(isHeadersBucket(commonHeaders) ? commonHeaders : undefined, isHeadersBucket(methodHeaders) ? methodHeaders : undefined);
16693
17251
  headers && utils_default.forEach(methodList_default.concat("common"), (method) => {
16694
- delete headers[method];
17252
+ if (isHeadersBucket(utils_default.getSafeProp(headers, method))) {
17253
+ delete headers[method];
17254
+ }
16695
17255
  });
16696
17256
  config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
16697
17257
  const requestInterceptorChain = [];
@@ -16771,7 +17331,7 @@ class Axios {
16771
17331
  }
16772
17332
  }
16773
17333
  utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
16774
- Axios.prototype[method] = function(url, config) {
17334
+ Axios.prototype[method] = async function(url, config) {
16775
17335
  return this.request(mergeConfig(config || {}, {
16776
17336
  method,
16777
17337
  url,
@@ -16781,7 +17341,7 @@ utils_default.forEach(["delete", "get", "head", "options"], function forEachMeth
16781
17341
  });
16782
17342
  utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
16783
17343
  function generateHTTPMethod(isForm) {
16784
- return function httpMethod(url, data, config) {
17344
+ return async function httpMethod(url, data, config) {
16785
17345
  return this.request(mergeConfig(config || {}, {
16786
17346
  method,
16787
17347
  headers: isForm ? {
@@ -16799,7 +17359,7 @@ utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodW
16799
17359
  });
16800
17360
  var Axios_default = Axios;
16801
17361
 
16802
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/cancel/CancelToken.js
17362
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/cancel/CancelToken.js
16803
17363
  class CancelToken {
16804
17364
  constructor(executor) {
16805
17365
  if (typeof executor !== "function") {
@@ -16885,19 +17445,19 @@ class CancelToken {
16885
17445
  }
16886
17446
  var CancelToken_default = CancelToken;
16887
17447
 
16888
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/spread.js
17448
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/spread.js
16889
17449
  function spread(callback) {
16890
17450
  return function wrap(arr) {
16891
17451
  return callback.apply(null, arr);
16892
17452
  };
16893
17453
  }
16894
17454
 
16895
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/isAxiosError.js
17455
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/isAxiosError.js
16896
17456
  function isAxiosError(payload) {
16897
17457
  return utils_default.isObject(payload) && payload.isAxiosError === true;
16898
17458
  }
16899
17459
 
16900
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/helpers/HttpStatusCode.js
17460
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/helpers/HttpStatusCode.js
16901
17461
  var HttpStatusCode = {
16902
17462
  Continue: 100,
16903
17463
  SwitchingProtocols: 101,
@@ -16979,7 +17539,7 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
16979
17539
  });
16980
17540
  var HttpStatusCode_default = HttpStatusCode;
16981
17541
 
16982
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/lib/axios.js
17542
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/lib/axios.js
16983
17543
  function createInstance(defaultConfig) {
16984
17544
  const context = new Axios_default(defaultConfig);
16985
17545
  const instance = bind(Axios_default.prototype.request, context);
@@ -17012,7 +17572,7 @@ axios.HttpStatusCode = HttpStatusCode_default;
17012
17572
  axios.default = axios;
17013
17573
  var axios_default = axios;
17014
17574
 
17015
- // ../../node_modules/.bun/axios@1.20.0+676106343bee98f0/node_modules/axios/index.js
17575
+ // ../../node_modules/.bun/axios@1.21.1+676106343bee98f0/node_modules/axios/index.js
17016
17576
  var {
17017
17577
  Axios: Axios2,
17018
17578
  AxiosError: AxiosError2,
@@ -17033,12 +17593,12 @@ var {
17033
17593
  create
17034
17594
  } = axios_default;
17035
17595
 
17036
- // ../../node_modules/.bun/@gravity-ai+api@1.2.1+676106343bee98f0/node_modules/@gravity-ai/api/dist/index.mjs
17596
+ // ../../node_modules/.bun/@gravity-ai+api@1.4.0+676106343bee98f0/node_modules/@gravity-ai/api/dist/index.mjs
17037
17597
  var require_package = __commonJS2({
17038
17598
  "package.json"(exports, module) {
17039
17599
  module.exports = {
17040
17600
  name: "@gravity-ai/api",
17041
- version: "1.2.1",
17601
+ version: "1.4.0",
17042
17602
  description: "Gravity JS SDK for retrieving targeted advertisements",
17043
17603
  main: "dist/index.js",
17044
17604
  module: "dist/index.mjs",
@@ -17100,17 +17660,182 @@ var require_package = __commonJS2({
17100
17660
  }
17101
17661
  },
17102
17662
  dependencies: {
17103
- axios: "^1.13.2"
17663
+ axios: "^1.21.0"
17104
17664
  },
17105
17665
  devDependencies: {
17106
- "@opentui/core": "^0.1.80",
17107
- tsup: "^8.0.1",
17666
+ "@opentui/core": "^0.8.0",
17667
+ tsup: "^9.0.0",
17108
17668
  typescript: "^5.3.3",
17109
- vitest: "^1.2.1"
17669
+ vitest: "^4.1.12"
17110
17670
  }
17111
17671
  };
17112
17672
  }
17113
17673
  });
17674
+ var pkg = (() => {
17675
+ try {
17676
+ return require_package();
17677
+ } catch {
17678
+ return { name: "@gravity-ai/api", version: "0.0.0" };
17679
+ }
17680
+ })();
17681
+ var SDK = { name: pkg.name, version: pkg.version };
17682
+ var GRAVITY_DARK_VARS = {
17683
+ "--gravity-bg": "#1F1F23",
17684
+ "--gravity-text": "#FAFAFA",
17685
+ "--gravity-text-muted": "#A1A1AA",
17686
+ "--gravity-border": "#3F3F46",
17687
+ "--gravity-muted": "#27272A",
17688
+ "--background": "240 6% 13%",
17689
+ "--foreground": "0 0% 98%",
17690
+ "--card": "240 6% 13%",
17691
+ "--card-foreground": "0 0% 98%",
17692
+ "--muted": "240 5% 16%",
17693
+ "--muted-foreground": "240 5% 65%",
17694
+ "--border": "240 5% 26%"
17695
+ };
17696
+ var GRAVITY_DARK_WIDGET_VARS = Object.fromEntries(Object.entries(GRAVITY_DARK_VARS).filter(([k]) => k.startsWith("--gravity-")));
17697
+ function parseColor(value) {
17698
+ const m = value.match(/rgba?\(([^)]+)\)/);
17699
+ if (!m)
17700
+ return null;
17701
+ const parts = m[1].split(",").map((p) => parseFloat(p.trim()));
17702
+ if (parts.length < 3 || parts.some((n) => Number.isNaN(n)))
17703
+ return null;
17704
+ return [parts[0], parts[1], parts[2], parts.length >= 4 ? parts[3] : 1];
17705
+ }
17706
+ function luminance(r, g, b) {
17707
+ return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
17708
+ }
17709
+ function effectiveBackground(el) {
17710
+ let node = el;
17711
+ while (node) {
17712
+ if (!node.hasAttribute("data-gravity-ad")) {
17713
+ const bg = getComputedStyle(node).backgroundColor;
17714
+ const c = bg ? parseColor(bg) : null;
17715
+ if (c && c[3] > 0.1)
17716
+ return [c[0], c[1], c[2]];
17717
+ }
17718
+ node = node.parentElement;
17719
+ }
17720
+ return null;
17721
+ }
17722
+ function hostIsDark(el) {
17723
+ try {
17724
+ const bg = effectiveBackground(el);
17725
+ if (bg)
17726
+ return luminance(bg[0], bg[1], bg[2]) < 0.4;
17727
+ const text = parseColor(getComputedStyle(el).color);
17728
+ if (text)
17729
+ return luminance(text[0], text[1], text[2]) > 0.6;
17730
+ return typeof matchMedia === "function" && matchMedia("(prefers-color-scheme: dark)").matches;
17731
+ } catch {
17732
+ return false;
17733
+ }
17734
+ }
17735
+ var SAMPLE = "Find the right tool for your team and ship your next project faster. Try it free today.";
17736
+ var SAMPLE_PX = 100;
17737
+ var metricsCache = /* @__PURE__ */ new Map;
17738
+ function hasDom() {
17739
+ return typeof window !== "undefined" && typeof document !== "undefined";
17740
+ }
17741
+ function hostElement(el) {
17742
+ if (el)
17743
+ return el;
17744
+ return hasDom() ? document.body ?? document.documentElement : null;
17745
+ }
17746
+ function primaryFamily(stack) {
17747
+ const first = stack.split(",")[0]?.trim().replace(/^["']|["']$/g, "");
17748
+ return first && first.length <= 80 ? first : undefined;
17749
+ }
17750
+ function hex(value) {
17751
+ const v = value.trim();
17752
+ if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(v)) {
17753
+ return (v.length === 4 ? "#" + [...v.slice(1)].map((c2) => c2 + c2).join("") : v).toUpperCase();
17754
+ }
17755
+ const c = parseColor(v);
17756
+ if (!c || c[3] === 0)
17757
+ return;
17758
+ return "#" + c.slice(0, 3).map((n) => Math.round(Math.min(255, Math.max(0, n))).toString(16).padStart(2, "0")).join("").toUpperCase();
17759
+ }
17760
+ function px(value, rootPx) {
17761
+ const m = /^(-?[\d.]+)(px|rem)$/.exec(value.trim());
17762
+ if (!m)
17763
+ return;
17764
+ const n = parseFloat(m[1]) * (m[2] === "rem" ? rootPx : 1);
17765
+ return Number.isFinite(n) && n >= 0 ? Math.round(n) : undefined;
17766
+ }
17767
+ function measureText(el) {
17768
+ try {
17769
+ const node = hostElement(el);
17770
+ if (!node)
17771
+ return;
17772
+ const stack = getComputedStyle(node).fontFamily;
17773
+ const fontFamily = stack ? primaryFamily(stack) : undefined;
17774
+ if (!fontFamily)
17775
+ return;
17776
+ const cached = metricsCache.get(stack);
17777
+ if (cached)
17778
+ return cached;
17779
+ const ctx = document.createElement("canvas").getContext("2d");
17780
+ if (!ctx)
17781
+ return { fontFamily };
17782
+ const measure = (weight) => {
17783
+ ctx.font = weight + " " + SAMPLE_PX + "px " + stack;
17784
+ return Math.round(ctx.measureText(SAMPLE).width / (SAMPLE.length * SAMPLE_PX) * 1000) / 1000;
17785
+ };
17786
+ const regular = measure(400);
17787
+ const bold = measure(700);
17788
+ if (!(regular > 0) || !(bold > 0))
17789
+ return { fontFamily };
17790
+ const metrics = { fontFamily, avgCharEm: { regular, bold } };
17791
+ const fonts = document.fonts;
17792
+ if (typeof fonts?.check !== "function" || fonts.check(SAMPLE_PX + "px " + stack))
17793
+ metricsCache.set(stack, metrics);
17794
+ return metrics;
17795
+ } catch {
17796
+ return;
17797
+ }
17798
+ }
17799
+ function readHostTheme(el) {
17800
+ try {
17801
+ const node = hostElement(el);
17802
+ if (!node)
17803
+ return;
17804
+ const cs = getComputedStyle(node);
17805
+ const theme = { scheme: hostIsDark(node) ? "dark" : "light" };
17806
+ const bg = effectiveBackground(node);
17807
+ if (bg)
17808
+ theme.background = hex("rgb(" + bg.join(",") + ")");
17809
+ const fg = hex(cs.color);
17810
+ if (fg)
17811
+ theme.foreground = fg;
17812
+ const accent = hex(cs.getPropertyValue("--gravity-accent"));
17813
+ if (accent)
17814
+ theme.accent = accent;
17815
+ const rootPx = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
17816
+ const radius = px(cs.getPropertyValue("--gravity-radius"), rootPx);
17817
+ if (radius !== undefined)
17818
+ theme.radius = radius;
17819
+ const family = cs.fontFamily ? primaryFamily(cs.fontFamily) : undefined;
17820
+ if (family)
17821
+ theme.fontFamily = family;
17822
+ return theme;
17823
+ } catch {
17824
+ return;
17825
+ }
17826
+ }
17827
+ function capabilitiesFor({ frames = false, promptAction = false, mcpConnect = false, banner = false } = {}) {
17828
+ const caps = ["units.v1", "image"];
17829
+ if (banner)
17830
+ caps.push("blocks.banner");
17831
+ if (frames)
17832
+ caps.push("frame.gfb1");
17833
+ if (promptAction)
17834
+ caps.push("action.prompt");
17835
+ if (mcpConnect)
17836
+ caps.push("connect.mcp");
17837
+ return caps;
17838
+ }
17114
17839
  var DEFAULT_GRAVITY_API = "https://server.trygravity.ai/api/v1/ad";
17115
17840
  var DEFAULT_TIMEOUT_MS = 4000;
17116
17841
  function toGravityMessages(messages, maxTurns = 2) {
@@ -17139,6 +17864,22 @@ function extractClientIp(req) {
17139
17864
  return req.ip;
17140
17865
  return;
17141
17866
  }
17867
+ function withUnitContext(placements, frames) {
17868
+ if (!Array.isArray(placements))
17869
+ return placements;
17870
+ const text = measureText();
17871
+ const theme = readHostTheme();
17872
+ return placements.map((p) => p && typeof p === "object" ? {
17873
+ ...text ? { text } : {},
17874
+ ...theme ? { theme } : {},
17875
+ capabilities: capabilitiesFor({
17876
+ frames,
17877
+ promptAction: p.supportsPromptAction === true,
17878
+ mcpConnect: p.supportsMcpConnect === true
17879
+ }),
17880
+ ...p
17881
+ } : p);
17882
+ }
17142
17883
  async function gravityAds(req, messages, placements, opts = {}) {
17143
17884
  const apiKey = opts.apiKey || (typeof process !== "undefined" ? process.env?.GRAVITY_API_KEY : undefined);
17144
17885
  const gravityApi = opts.gravityApi || DEFAULT_GRAVITY_API;
@@ -17150,10 +17891,13 @@ async function gravityAds(req, messages, placements, opts = {}) {
17150
17891
  const clientUser = ctx?.user || {};
17151
17892
  const clientDevice = ctx?.device || {};
17152
17893
  const clientIp = extractClientIp(req);
17894
+ const supportsSpec = opts.supportsSpec ?? true;
17895
+ const frames = opts.enableFrames ?? supportsSpec;
17153
17896
  const body = {
17897
+ sdk: SDK,
17154
17898
  messages: toGravityMessages(messages),
17155
17899
  sessionId: ctx?.sessionId,
17156
- placements,
17900
+ placements: supportsSpec ? withUnitContext(placements, frames) : placements,
17157
17901
  user: {
17158
17902
  ...clientUser,
17159
17903
  id: clientUser.id || clientUser.userId || "anonymous"
@@ -17170,16 +17914,19 @@ async function gravityAds(req, messages, placements, opts = {}) {
17170
17914
  body.testAd = opts.production === true ? false : true;
17171
17915
  if (body.testAd && opts.alwaysReturn === true)
17172
17916
  body.alwaysReturn = true;
17173
- const supportsSpec = opts.supportsSpec ?? true;
17917
+ if (body.testAd && opts.testAdFormat === "action")
17918
+ body.testAdFormat = "action";
17174
17919
  body.supportsSpec = supportsSpec;
17175
17920
  if (supportsSpec)
17176
17921
  body.specCapabilities = opts.specCapabilities ?? "web1";
17177
- if (opts.enableFrames ?? supportsSpec)
17922
+ if (frames)
17178
17923
  body.supportsFrames = true;
17179
17924
  if (body.testAd && opts.adLayout)
17180
17925
  body.adLayout = opts.adLayout;
17181
17926
  if (opts.excludedTopics)
17182
17927
  body.excludedTopics = opts.excludedTopics;
17928
+ if (opts.usage)
17929
+ body.usage = opts.usage;
17183
17930
  const start = performance.now();
17184
17931
  try {
17185
17932
  const res = await fetch(gravityApi, {
@@ -17380,13 +18127,38 @@ async function gravityContextAsync(overrides) {
17380
18127
  const consent = overrides.consent ?? (isBrowser ? await readCmpConsent() : undefined);
17381
18128
  return gravityContext(consent ? { ...overrides, consent } : overrides);
17382
18129
  }
18130
+ function browserDeviceCategory(ua, maxTouchPoints) {
18131
+ if (/iPad/.test(ua) || /Macintosh/.test(ua) && maxTouchPoints > 1) {
18132
+ return { device_type: "tablet", os: "ios" };
18133
+ }
18134
+ if (/iPhone|iPod/.test(ua))
18135
+ return { device_type: "mobile", os: "ios" };
18136
+ if (/Android/.test(ua)) {
18137
+ return { device_type: /Mobile/.test(ua) ? "mobile" : "tablet", os: "android" };
18138
+ }
18139
+ if (/CrOS/.test(ua))
18140
+ return { device_type: "desktop", os: "chromeos" };
18141
+ if (/Windows/.test(ua))
18142
+ return { device_type: "desktop", os: "windows" };
18143
+ if (/Macintosh|Mac OS X/.test(ua))
18144
+ return { device_type: "desktop", os: "macos" };
18145
+ if (/Linux/.test(ua))
18146
+ return { device_type: "desktop", os: "linux" };
18147
+ return { device_type: /Mobi/.test(ua) ? "mobile" : "desktop", os: "other" };
18148
+ }
18149
+ var NODE_OS_CATEGORY = {
18150
+ darwin: "macos",
18151
+ win32: "windows",
18152
+ linux: "linux",
18153
+ android: "android"
18154
+ };
17383
18155
  function browserDevice() {
17384
18156
  const nav = typeof navigator !== "undefined" ? navigator : undefined;
17385
18157
  const win = typeof window !== "undefined" ? window : undefined;
17386
18158
  return {
17387
18159
  ua: nav?.userAgent || "",
17388
18160
  browser: "web",
17389
- device_type: /Mobi|Android/i.test(nav?.userAgent || "") ? "mobile" : "desktop",
18161
+ ...browserDeviceCategory(nav?.userAgent || "", nav?.maxTouchPoints || 0),
17390
18162
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
17391
18163
  locale: Intl.DateTimeFormat().resolvedOptions().locale,
17392
18164
  language: nav?.language || "en",
@@ -17423,10 +18195,11 @@ function nodeDevice() {
17423
18195
  const rows = typeof process !== "undefined" ? process.stdout?.rows || 24 : 24;
17424
18196
  const env = typeof process !== "undefined" ? process.env : {};
17425
18197
  return {
17426
- ua: `gravity-js/${PKG_VERSION} (${os?.type() || "unknown"} ${os?.arch() || "unknown"}; ${runtimeTag})`,
17427
- os: os ? `${os.type()} ${os.release()}` : undefined,
18198
+ ua: `gravity-js/${SDK.version} (${os?.type() || "unknown"} ${os?.arch() || "unknown"}; ${runtimeTag})`,
18199
+ os: typeof process !== "undefined" && NODE_OS_CATEGORY[process.platform] || "other",
18200
+ os_version: os ? `${os.type()} ${os.release()}` : undefined,
17428
18201
  browser: "cli",
17429
- device_type: env.CI ? "server" : "desktop",
18202
+ device_type: "desktop",
17430
18203
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
17431
18204
  locale: Intl.DateTimeFormat().resolvedOptions().locale,
17432
18205
  language: env.LANG?.split(".")[0]?.replace("_", "-") || "en",
@@ -17443,13 +18216,6 @@ function nodeDevice() {
17443
18216
  is_ci: !!env.CI
17444
18217
  };
17445
18218
  }
17446
- var PKG_VERSION = (() => {
17447
- try {
17448
- return require_package().version;
17449
- } catch {
17450
- return "0.0.0";
17451
- }
17452
- })();
17453
18219
  var DEFAULT_ENDPOINT = "https://server.trygravity.ai";
17454
18220
  var REQUEST_TIMEOUT = 1e4;
17455
18221
  var Client = class {
@@ -17472,6 +18238,7 @@ var Client = class {
17472
18238
  const supportsSpec = params.supportsSpec ?? true;
17473
18239
  const { enableFrames, ...requestParams } = params;
17474
18240
  const body = {
18241
+ sdk: SDK,
17475
18242
  ...requestParams,
17476
18243
  ...enableFrames ?? supportsSpec ? { supportsFrames: true } : {},
17477
18244
  supportsSpec,
@@ -17521,8 +18288,8 @@ async function sha256Hex(value) {
17521
18288
  try {
17522
18289
  const bytes = new TextEncoder().encode(value);
17523
18290
  const digest = await subtle.digest("SHA-256", bytes);
17524
- const hex = Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
17525
- return hex;
18291
+ const hex2 = Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
18292
+ return hex2;
17526
18293
  } catch {
17527
18294
  return;
17528
18295
  }
@@ -17554,8 +18321,8 @@ async function hashPii(values) {
17554
18321
  return out;
17555
18322
  }
17556
18323
  function uuid(prefix) {
17557
- const hex = () => Math.random().toString(36).slice(2, 10);
17558
- return prefix + hex() + hex();
18324
+ const hex2 = () => Math.random().toString(36).slice(2, 10);
18325
+ return prefix + hex2() + hex2();
17559
18326
  }
17560
18327
  function nowMs() {
17561
18328
  return Date.now();