@imtbl/sdk 0.39.1 → 0.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import * as crypto from 'crypto';
6
6
  import { Magic } from 'magic-sdk';
7
7
  import { OpenIdExtension } from '@magic-ext/oidc';
8
8
  import { JsonRpcProvider, Web3Provider } from '@ethersproject/providers';
9
- import { BigNumber as BigNumber$1, ethers, providers, constants as constants$1, ContractFactory, utils as utils$2, Contract as Contract$1 } from 'ethers';
9
+ import { BigNumber as BigNumber$1, ethers, providers, constants as constants$1, ContractFactory, utils as utils$3, Contract as Contract$1 } from 'ethers';
10
10
  import BN$2 from 'bn.js';
11
11
  import * as encUtils from 'enc-utils';
12
12
  import { EventEmitter } from 'events';
@@ -4234,7 +4234,7 @@ class MultiRollupApiClients {
4234
4234
  }
4235
4235
 
4236
4236
  // eslint-disable-next-line @typescript-eslint/naming-convention
4237
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.1' };
4237
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.2' };
4238
4238
  const createConfig = ({ basePath, headers, }) => {
4239
4239
  if (!basePath.trim()) {
4240
4240
  throw Error('basePath can not be empty');
@@ -4294,7 +4294,7 @@ class APIError extends Error {
4294
4294
 
4295
4295
  /* eslint-disable implicit-arrow-linebreak */
4296
4296
  const defaultHeaders = {
4297
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.1',
4297
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.2',
4298
4298
  };
4299
4299
  /**
4300
4300
  * createAPIConfiguration to create a custom Configuration
@@ -4733,7 +4733,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4733
4733
  chainID,
4734
4734
  coreContractAddress,
4735
4735
  registrationContractAddress,
4736
- sdkVersion: 'ts-immutable-sdk-0.39.1',
4736
+ sdkVersion: 'ts-immutable-sdk-0.39.2',
4737
4737
  });
4738
4738
  /**
4739
4739
  * Sets `sdkVersion` at the time of build
@@ -5788,8 +5788,9 @@ const reduceDescriptors$1 = (obj, reducer) => {
5788
5788
  const reducedDescriptors = {};
5789
5789
 
5790
5790
  forEach$1(descriptors, (descriptor, name) => {
5791
- if (reducer(descriptor, name, obj) !== false) {
5792
- reducedDescriptors[name] = descriptor;
5791
+ let ret;
5792
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
5793
+ reducedDescriptors[name] = ret || descriptor;
5793
5794
  }
5794
5795
  });
5795
5796
 
@@ -5915,7 +5916,7 @@ const isAsyncFn$1 = kindOfTest$1('AsyncFunction');
5915
5916
  const isThenable$1 = (thing) =>
5916
5917
  thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
5917
5918
 
5918
- var utils$1 = {
5919
+ var utils$1$1 = {
5919
5920
  isArray: isArray$1,
5920
5921
  isArrayBuffer: isArrayBuffer$1,
5921
5922
  isBuffer: isBuffer$1,
@@ -5997,7 +5998,7 @@ function AxiosError$1(message, code, config, request, response) {
5997
5998
  response && (this.response = response);
5998
5999
  }
5999
6000
 
6000
- utils$1.inherits(AxiosError$1, Error, {
6001
+ utils$1$1.inherits(AxiosError$1, Error, {
6001
6002
  toJSON: function toJSON() {
6002
6003
  return {
6003
6004
  // Standard
@@ -6012,7 +6013,7 @@ utils$1.inherits(AxiosError$1, Error, {
6012
6013
  columnNumber: this.columnNumber,
6013
6014
  stack: this.stack,
6014
6015
  // Axios
6015
- config: utils$1.toJSONObject(this.config),
6016
+ config: utils$1$1.toJSONObject(this.config),
6016
6017
  code: this.code,
6017
6018
  status: this.response && this.response.status ? this.response.status : null
6018
6019
  };
@@ -6047,7 +6048,7 @@ Object.defineProperty(prototype$1$1, 'isAxiosError', {value: true});
6047
6048
  AxiosError$1.from = (error, code, config, request, response, customProps) => {
6048
6049
  const axiosError = Object.create(prototype$1$1);
6049
6050
 
6050
- utils$1.toFlatObject(error, axiosError, function filter(obj) {
6051
+ utils$1$1.toFlatObject(error, axiosError, function filter(obj) {
6051
6052
  return obj !== Error.prototype;
6052
6053
  }, prop => {
6053
6054
  return prop !== 'isAxiosError';
@@ -6075,7 +6076,7 @@ var httpAdapter$1 = null;
6075
6076
  * @returns {boolean}
6076
6077
  */
6077
6078
  function isVisitable$1(thing) {
6078
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
6079
+ return utils$1$1.isPlainObject(thing) || utils$1$1.isArray(thing);
6079
6080
  }
6080
6081
 
6081
6082
  /**
@@ -6086,7 +6087,7 @@ function isVisitable$1(thing) {
6086
6087
  * @returns {string} the key without the brackets.
6087
6088
  */
6088
6089
  function removeBrackets$1(key) {
6089
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
6090
+ return utils$1$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
6090
6091
  }
6091
6092
 
6092
6093
  /**
@@ -6115,10 +6116,10 @@ function renderKey$1(path, key, dots) {
6115
6116
  * @returns {boolean}
6116
6117
  */
6117
6118
  function isFlatArray$1(arr) {
6118
- return utils$1.isArray(arr) && !arr.some(isVisitable$1);
6119
+ return utils$1$1.isArray(arr) && !arr.some(isVisitable$1);
6119
6120
  }
6120
6121
 
6121
- const predicates$1 = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
6122
+ const predicates$1 = utils$1$1.toFlatObject(utils$1$1, {}, null, function filter(prop) {
6122
6123
  return /^is[A-Z]/.test(prop);
6123
6124
  });
6124
6125
 
@@ -6146,7 +6147,7 @@ const predicates$1 = utils$1.toFlatObject(utils$1, {}, null, function filter(pro
6146
6147
  * @returns
6147
6148
  */
6148
6149
  function toFormData$1(obj, formData, options) {
6149
- if (!utils$1.isObject(obj)) {
6150
+ if (!utils$1$1.isObject(obj)) {
6150
6151
  throw new TypeError('target must be an object');
6151
6152
  }
6152
6153
 
@@ -6154,13 +6155,13 @@ function toFormData$1(obj, formData, options) {
6154
6155
  formData = formData || new (FormData)();
6155
6156
 
6156
6157
  // eslint-disable-next-line no-param-reassign
6157
- options = utils$1.toFlatObject(options, {
6158
+ options = utils$1$1.toFlatObject(options, {
6158
6159
  metaTokens: true,
6159
6160
  dots: false,
6160
6161
  indexes: false
6161
6162
  }, false, function defined(option, source) {
6162
6163
  // eslint-disable-next-line no-eq-null,eqeqeq
6163
- return !utils$1.isUndefined(source[option]);
6164
+ return !utils$1$1.isUndefined(source[option]);
6164
6165
  });
6165
6166
 
6166
6167
  const metaTokens = options.metaTokens;
@@ -6169,24 +6170,24 @@ function toFormData$1(obj, formData, options) {
6169
6170
  const dots = options.dots;
6170
6171
  const indexes = options.indexes;
6171
6172
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
6172
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
6173
+ const useBlob = _Blob && utils$1$1.isSpecCompliantForm(formData);
6173
6174
 
6174
- if (!utils$1.isFunction(visitor)) {
6175
+ if (!utils$1$1.isFunction(visitor)) {
6175
6176
  throw new TypeError('visitor must be a function');
6176
6177
  }
6177
6178
 
6178
6179
  function convertValue(value) {
6179
6180
  if (value === null) return '';
6180
6181
 
6181
- if (utils$1.isDate(value)) {
6182
+ if (utils$1$1.isDate(value)) {
6182
6183
  return value.toISOString();
6183
6184
  }
6184
6185
 
6185
- if (!useBlob && utils$1.isBlob(value)) {
6186
+ if (!useBlob && utils$1$1.isBlob(value)) {
6186
6187
  throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
6187
6188
  }
6188
6189
 
6189
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
6190
+ if (utils$1$1.isArrayBuffer(value) || utils$1$1.isTypedArray(value)) {
6190
6191
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
6191
6192
  }
6192
6193
 
@@ -6207,20 +6208,20 @@ function toFormData$1(obj, formData, options) {
6207
6208
  let arr = value;
6208
6209
 
6209
6210
  if (value && !path && typeof value === 'object') {
6210
- if (utils$1.endsWith(key, '{}')) {
6211
+ if (utils$1$1.endsWith(key, '{}')) {
6211
6212
  // eslint-disable-next-line no-param-reassign
6212
6213
  key = metaTokens ? key : key.slice(0, -2);
6213
6214
  // eslint-disable-next-line no-param-reassign
6214
6215
  value = JSON.stringify(value);
6215
6216
  } else if (
6216
- (utils$1.isArray(value) && isFlatArray$1(value)) ||
6217
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
6217
+ (utils$1$1.isArray(value) && isFlatArray$1(value)) ||
6218
+ ((utils$1$1.isFileList(value) || utils$1$1.endsWith(key, '[]')) && (arr = utils$1$1.toArray(value))
6218
6219
  )) {
6219
6220
  // eslint-disable-next-line no-param-reassign
6220
6221
  key = removeBrackets$1(key);
6221
6222
 
6222
6223
  arr.forEach(function each(el, index) {
6223
- !(utils$1.isUndefined(el) || el === null) && formData.append(
6224
+ !(utils$1$1.isUndefined(el) || el === null) && formData.append(
6224
6225
  // eslint-disable-next-line no-nested-ternary
6225
6226
  indexes === true ? renderKey$1([key], index, dots) : (indexes === null ? key : key + '[]'),
6226
6227
  convertValue(el)
@@ -6248,7 +6249,7 @@ function toFormData$1(obj, formData, options) {
6248
6249
  });
6249
6250
 
6250
6251
  function build(value, path) {
6251
- if (utils$1.isUndefined(value)) return;
6252
+ if (utils$1$1.isUndefined(value)) return;
6252
6253
 
6253
6254
  if (stack.indexOf(value) !== -1) {
6254
6255
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -6256,9 +6257,9 @@ function toFormData$1(obj, formData, options) {
6256
6257
 
6257
6258
  stack.push(value);
6258
6259
 
6259
- utils$1.forEach(value, function each(el, key) {
6260
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
6261
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
6260
+ utils$1$1.forEach(value, function each(el, key) {
6261
+ const result = !(utils$1$1.isUndefined(el) || el === null) && visitor.call(
6262
+ formData, el, utils$1$1.isString(key) ? key.trim() : key, path, exposedHelpers
6262
6263
  );
6263
6264
 
6264
6265
  if (result === true) {
@@ -6269,7 +6270,7 @@ function toFormData$1(obj, formData, options) {
6269
6270
  stack.pop();
6270
6271
  }
6271
6272
 
6272
- if (!utils$1.isObject(obj)) {
6273
+ if (!utils$1$1.isObject(obj)) {
6273
6274
  throw new TypeError('data must be an object');
6274
6275
  }
6275
6276
 
@@ -6373,7 +6374,7 @@ function buildURL$1(url, params, options) {
6373
6374
  if (serializeFn) {
6374
6375
  serializedParams = serializeFn(params, options);
6375
6376
  } else {
6376
- serializedParams = utils$1.isURLSearchParams(params) ?
6377
+ serializedParams = utils$1$1.isURLSearchParams(params) ?
6377
6378
  params.toString() :
6378
6379
  new AxiosURLSearchParams$1(params, options).toString(_encode);
6379
6380
  }
@@ -6448,7 +6449,7 @@ let InterceptorManager$2 = class InterceptorManager {
6448
6449
  * @returns {void}
6449
6450
  */
6450
6451
  forEach(fn) {
6451
- utils$1.forEach(this.handlers, function forEachHandler(h) {
6452
+ utils$1$1.forEach(this.handlers, function forEachHandler(h) {
6452
6453
  if (h !== null) {
6453
6454
  fn(h);
6454
6455
  }
@@ -6470,6 +6471,18 @@ var FormData$1$1 = typeof FormData !== 'undefined' ? FormData : null;
6470
6471
 
6471
6472
  var Blob$1$1 = typeof Blob !== 'undefined' ? Blob : null;
6472
6473
 
6474
+ var platform$1$1 = {
6475
+ isBrowser: true,
6476
+ classes: {
6477
+ URLSearchParams: URLSearchParams$1$1,
6478
+ FormData: FormData$1$1,
6479
+ Blob: Blob$1$1
6480
+ },
6481
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
6482
+ };
6483
+
6484
+ const hasBrowserEnv$1 = typeof window !== 'undefined' && typeof document !== 'undefined';
6485
+
6473
6486
  /**
6474
6487
  * Determine if we're running in a standard browser environment
6475
6488
  *
@@ -6487,18 +6500,10 @@ var Blob$1$1 = typeof Blob !== 'undefined' ? Blob : null;
6487
6500
  *
6488
6501
  * @returns {boolean}
6489
6502
  */
6490
- const isStandardBrowserEnv$1 = (() => {
6491
- let product;
6492
- if (typeof navigator !== 'undefined' && (
6493
- (product = navigator.product) === 'ReactNative' ||
6494
- product === 'NativeScript' ||
6495
- product === 'NS')
6496
- ) {
6497
- return false;
6498
- }
6499
-
6500
- return typeof window !== 'undefined' && typeof document !== 'undefined';
6501
- })();
6503
+ const hasStandardBrowserEnv$1 = (
6504
+ (product) => {
6505
+ return hasBrowserEnv$1 && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
6506
+ })(typeof navigator !== 'undefined' && navigator.product);
6502
6507
 
6503
6508
  /**
6504
6509
  * Determine if we're running in a standard browser webWorker environment
@@ -6509,7 +6514,7 @@ const isStandardBrowserEnv$1 = (() => {
6509
6514
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
6510
6515
  * This leads to a problem when axios post `FormData` in webWorker
6511
6516
  */
6512
- const isStandardBrowserWebWorkerEnv$1 = (() => {
6517
+ const hasStandardBrowserWebWorkerEnv$1 = (() => {
6513
6518
  return (
6514
6519
  typeof WorkerGlobalScope !== 'undefined' &&
6515
6520
  // eslint-disable-next-line no-undef
@@ -6518,23 +6523,22 @@ const isStandardBrowserEnv$1 = (() => {
6518
6523
  );
6519
6524
  })();
6520
6525
 
6526
+ var utils$2 = /*#__PURE__*/Object.freeze({
6527
+ __proto__: null,
6528
+ hasBrowserEnv: hasBrowserEnv$1,
6529
+ hasStandardBrowserEnv: hasStandardBrowserEnv$1,
6530
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv$1
6531
+ });
6521
6532
 
6522
- var platform$1 = {
6523
- isBrowser: true,
6524
- classes: {
6525
- URLSearchParams: URLSearchParams$1$1,
6526
- FormData: FormData$1$1,
6527
- Blob: Blob$1$1
6528
- },
6529
- isStandardBrowserEnv: isStandardBrowserEnv$1,
6530
- isStandardBrowserWebWorkerEnv: isStandardBrowserWebWorkerEnv$1,
6531
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
6533
+ var platform$2 = {
6534
+ ...utils$2,
6535
+ ...platform$1$1
6532
6536
  };
6533
6537
 
6534
6538
  function toURLEncodedForm$1(data, options) {
6535
- return toFormData$1(data, new platform$1.classes.URLSearchParams(), Object.assign({
6539
+ return toFormData$1(data, new platform$2.classes.URLSearchParams(), Object.assign({
6536
6540
  visitor: function(value, key, path, helpers) {
6537
- if (platform$1.isNode && utils$1.isBuffer(value)) {
6541
+ if (platform$2.isNode && utils$1$1.isBuffer(value)) {
6538
6542
  this.append(key, value.toString('base64'));
6539
6543
  return false;
6540
6544
  }
@@ -6556,7 +6560,7 @@ function parsePropPath$1(name) {
6556
6560
  // foo.x.y.z
6557
6561
  // foo-x-y-z
6558
6562
  // foo x y z
6559
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
6563
+ return utils$1$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
6560
6564
  return match[0] === '[]' ? '' : match[1] || match[0];
6561
6565
  });
6562
6566
  }
@@ -6591,12 +6595,15 @@ function arrayToObject$1(arr) {
6591
6595
  function formDataToJSON$1(formData) {
6592
6596
  function buildPath(path, value, target, index) {
6593
6597
  let name = path[index++];
6598
+
6599
+ if (name === '__proto__') return true;
6600
+
6594
6601
  const isNumericKey = Number.isFinite(+name);
6595
6602
  const isLast = index >= path.length;
6596
- name = !name && utils$1.isArray(target) ? target.length : name;
6603
+ name = !name && utils$1$1.isArray(target) ? target.length : name;
6597
6604
 
6598
6605
  if (isLast) {
6599
- if (utils$1.hasOwnProp(target, name)) {
6606
+ if (utils$1$1.hasOwnProp(target, name)) {
6600
6607
  target[name] = [target[name], value];
6601
6608
  } else {
6602
6609
  target[name] = value;
@@ -6605,23 +6612,23 @@ function formDataToJSON$1(formData) {
6605
6612
  return !isNumericKey;
6606
6613
  }
6607
6614
 
6608
- if (!target[name] || !utils$1.isObject(target[name])) {
6615
+ if (!target[name] || !utils$1$1.isObject(target[name])) {
6609
6616
  target[name] = [];
6610
6617
  }
6611
6618
 
6612
6619
  const result = buildPath(path, value, target[name], index);
6613
6620
 
6614
- if (result && utils$1.isArray(target[name])) {
6621
+ if (result && utils$1$1.isArray(target[name])) {
6615
6622
  target[name] = arrayToObject$1(target[name]);
6616
6623
  }
6617
6624
 
6618
6625
  return !isNumericKey;
6619
6626
  }
6620
6627
 
6621
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
6628
+ if (utils$1$1.isFormData(formData) && utils$1$1.isFunction(formData.entries)) {
6622
6629
  const obj = {};
6623
6630
 
6624
- utils$1.forEachEntry(formData, (name, value) => {
6631
+ utils$1$1.forEachEntry(formData, (name, value) => {
6625
6632
  buildPath(parsePropPath$1(name), value, obj, 0);
6626
6633
  });
6627
6634
 
@@ -6631,10 +6638,6 @@ function formDataToJSON$1(formData) {
6631
6638
  return null;
6632
6639
  }
6633
6640
 
6634
- const DEFAULT_CONTENT_TYPE$1 = {
6635
- 'Content-Type': undefined
6636
- };
6637
-
6638
6641
  /**
6639
6642
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
6640
6643
  * of the input
@@ -6646,10 +6649,10 @@ const DEFAULT_CONTENT_TYPE$1 = {
6646
6649
  * @returns {string} A stringified version of the rawValue.
6647
6650
  */
6648
6651
  function stringifySafely$1(rawValue, parser, encoder) {
6649
- if (utils$1.isString(rawValue)) {
6652
+ if (utils$1$1.isString(rawValue)) {
6650
6653
  try {
6651
6654
  (parser || JSON.parse)(rawValue);
6652
- return utils$1.trim(rawValue);
6655
+ return utils$1$1.trim(rawValue);
6653
6656
  } catch (e) {
6654
6657
  if (e.name !== 'SyntaxError') {
6655
6658
  throw e;
@@ -6669,13 +6672,13 @@ const defaults$2 = {
6669
6672
  transformRequest: [function transformRequest(data, headers) {
6670
6673
  const contentType = headers.getContentType() || '';
6671
6674
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
6672
- const isObjectPayload = utils$1.isObject(data);
6675
+ const isObjectPayload = utils$1$1.isObject(data);
6673
6676
 
6674
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
6677
+ if (isObjectPayload && utils$1$1.isHTMLForm(data)) {
6675
6678
  data = new FormData(data);
6676
6679
  }
6677
6680
 
6678
- const isFormData = utils$1.isFormData(data);
6681
+ const isFormData = utils$1$1.isFormData(data);
6679
6682
 
6680
6683
  if (isFormData) {
6681
6684
  if (!hasJSONContentType) {
@@ -6684,18 +6687,18 @@ const defaults$2 = {
6684
6687
  return hasJSONContentType ? JSON.stringify(formDataToJSON$1(data)) : data;
6685
6688
  }
6686
6689
 
6687
- if (utils$1.isArrayBuffer(data) ||
6688
- utils$1.isBuffer(data) ||
6689
- utils$1.isStream(data) ||
6690
- utils$1.isFile(data) ||
6691
- utils$1.isBlob(data)
6690
+ if (utils$1$1.isArrayBuffer(data) ||
6691
+ utils$1$1.isBuffer(data) ||
6692
+ utils$1$1.isStream(data) ||
6693
+ utils$1$1.isFile(data) ||
6694
+ utils$1$1.isBlob(data)
6692
6695
  ) {
6693
6696
  return data;
6694
6697
  }
6695
- if (utils$1.isArrayBufferView(data)) {
6698
+ if (utils$1$1.isArrayBufferView(data)) {
6696
6699
  return data.buffer;
6697
6700
  }
6698
- if (utils$1.isURLSearchParams(data)) {
6701
+ if (utils$1$1.isURLSearchParams(data)) {
6699
6702
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
6700
6703
  return data.toString();
6701
6704
  }
@@ -6707,7 +6710,7 @@ const defaults$2 = {
6707
6710
  return toURLEncodedForm$1(data, this.formSerializer).toString();
6708
6711
  }
6709
6712
 
6710
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
6713
+ if ((isFileList = utils$1$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
6711
6714
  const _FormData = this.env && this.env.FormData;
6712
6715
 
6713
6716
  return toFormData$1(
@@ -6731,7 +6734,7 @@ const defaults$2 = {
6731
6734
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
6732
6735
  const JSONRequested = this.responseType === 'json';
6733
6736
 
6734
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
6737
+ if (data && utils$1$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
6735
6738
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
6736
6739
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
6737
6740
 
@@ -6763,8 +6766,8 @@ const defaults$2 = {
6763
6766
  maxBodyLength: -1,
6764
6767
 
6765
6768
  env: {
6766
- FormData: platform$1.classes.FormData,
6767
- Blob: platform$1.classes.Blob
6769
+ FormData: platform$2.classes.FormData,
6770
+ Blob: platform$2.classes.Blob
6768
6771
  },
6769
6772
 
6770
6773
  validateStatus: function validateStatus(status) {
@@ -6773,24 +6776,21 @@ const defaults$2 = {
6773
6776
 
6774
6777
  headers: {
6775
6778
  common: {
6776
- 'Accept': 'application/json, text/plain, */*'
6779
+ 'Accept': 'application/json, text/plain, */*',
6780
+ 'Content-Type': undefined
6777
6781
  }
6778
6782
  }
6779
6783
  };
6780
6784
 
6781
- utils$1.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
6785
+ utils$1$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
6782
6786
  defaults$2.headers[method] = {};
6783
6787
  });
6784
6788
 
6785
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
6786
- defaults$2.headers[method] = utils$1.merge(DEFAULT_CONTENT_TYPE$1);
6787
- });
6788
-
6789
6789
  var defaults$1$1 = defaults$2;
6790
6790
 
6791
6791
  // RawAxiosHeaders whose duplicates are ignored by node
6792
6792
  // c.f. https://nodejs.org/api/http.html#http_message_headers
6793
- const ignoreDuplicateOf$1 = utils$1.toObjectSet([
6793
+ const ignoreDuplicateOf$1 = utils$1$1.toObjectSet([
6794
6794
  'age', 'authorization', 'content-length', 'content-type', 'etag',
6795
6795
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
6796
6796
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -6851,7 +6851,7 @@ function normalizeValue$1(value) {
6851
6851
  return value;
6852
6852
  }
6853
6853
 
6854
- return utils$1.isArray(value) ? value.map(normalizeValue$1) : String(value);
6854
+ return utils$1$1.isArray(value) ? value.map(normalizeValue$1) : String(value);
6855
6855
  }
6856
6856
 
6857
6857
  function parseTokens$1(str) {
@@ -6869,7 +6869,7 @@ function parseTokens$1(str) {
6869
6869
  const isValidHeaderName$1 = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
6870
6870
 
6871
6871
  function matchHeaderValue$1(context, value, header, filter, isHeaderNameFilter) {
6872
- if (utils$1.isFunction(filter)) {
6872
+ if (utils$1$1.isFunction(filter)) {
6873
6873
  return filter.call(this, value, header);
6874
6874
  }
6875
6875
 
@@ -6877,13 +6877,13 @@ function matchHeaderValue$1(context, value, header, filter, isHeaderNameFilter)
6877
6877
  value = header;
6878
6878
  }
6879
6879
 
6880
- if (!utils$1.isString(value)) return;
6880
+ if (!utils$1$1.isString(value)) return;
6881
6881
 
6882
- if (utils$1.isString(filter)) {
6882
+ if (utils$1$1.isString(filter)) {
6883
6883
  return value.indexOf(filter) !== -1;
6884
6884
  }
6885
6885
 
6886
- if (utils$1.isRegExp(filter)) {
6886
+ if (utils$1$1.isRegExp(filter)) {
6887
6887
  return filter.test(value);
6888
6888
  }
6889
6889
  }
@@ -6896,7 +6896,7 @@ function formatHeader$1(header) {
6896
6896
  }
6897
6897
 
6898
6898
  function buildAccessors$1(obj, header) {
6899
- const accessorName = utils$1.toCamelCase(' ' + header);
6899
+ const accessorName = utils$1$1.toCamelCase(' ' + header);
6900
6900
 
6901
6901
  ['get', 'set', 'has'].forEach(methodName => {
6902
6902
  Object.defineProperty(obj, methodName + accessorName, {
@@ -6923,7 +6923,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
6923
6923
  throw new Error('header name must be a non-empty string');
6924
6924
  }
6925
6925
 
6926
- const key = utils$1.findKey(self, lHeader);
6926
+ const key = utils$1$1.findKey(self, lHeader);
6927
6927
 
6928
6928
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
6929
6929
  self[key || _header] = normalizeValue$1(_value);
@@ -6931,11 +6931,11 @@ let AxiosHeaders$2 = class AxiosHeaders {
6931
6931
  }
6932
6932
 
6933
6933
  const setHeaders = (headers, _rewrite) =>
6934
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
6934
+ utils$1$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
6935
6935
 
6936
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
6936
+ if (utils$1$1.isPlainObject(header) || header instanceof this.constructor) {
6937
6937
  setHeaders(header, valueOrRewrite);
6938
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName$1(header)) {
6938
+ } else if(utils$1$1.isString(header) && (header = header.trim()) && !isValidHeaderName$1(header)) {
6939
6939
  setHeaders(parseHeaders$1(header), valueOrRewrite);
6940
6940
  } else {
6941
6941
  header != null && setHeader(valueOrRewrite, header, rewrite);
@@ -6948,7 +6948,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
6948
6948
  header = normalizeHeader$1(header);
6949
6949
 
6950
6950
  if (header) {
6951
- const key = utils$1.findKey(this, header);
6951
+ const key = utils$1$1.findKey(this, header);
6952
6952
 
6953
6953
  if (key) {
6954
6954
  const value = this[key];
@@ -6961,11 +6961,11 @@ let AxiosHeaders$2 = class AxiosHeaders {
6961
6961
  return parseTokens$1(value);
6962
6962
  }
6963
6963
 
6964
- if (utils$1.isFunction(parser)) {
6964
+ if (utils$1$1.isFunction(parser)) {
6965
6965
  return parser.call(this, value, key);
6966
6966
  }
6967
6967
 
6968
- if (utils$1.isRegExp(parser)) {
6968
+ if (utils$1$1.isRegExp(parser)) {
6969
6969
  return parser.exec(value);
6970
6970
  }
6971
6971
 
@@ -6978,7 +6978,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
6978
6978
  header = normalizeHeader$1(header);
6979
6979
 
6980
6980
  if (header) {
6981
- const key = utils$1.findKey(this, header);
6981
+ const key = utils$1$1.findKey(this, header);
6982
6982
 
6983
6983
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue$1(this, this[key], key, matcher)));
6984
6984
  }
@@ -6994,7 +6994,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
6994
6994
  _header = normalizeHeader$1(_header);
6995
6995
 
6996
6996
  if (_header) {
6997
- const key = utils$1.findKey(self, _header);
6997
+ const key = utils$1$1.findKey(self, _header);
6998
6998
 
6999
6999
  if (key && (!matcher || matchHeaderValue$1(self, self[key], key, matcher))) {
7000
7000
  delete self[key];
@@ -7004,7 +7004,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
7004
7004
  }
7005
7005
  }
7006
7006
 
7007
- if (utils$1.isArray(header)) {
7007
+ if (utils$1$1.isArray(header)) {
7008
7008
  header.forEach(deleteHeader);
7009
7009
  } else {
7010
7010
  deleteHeader(header);
@@ -7033,8 +7033,8 @@ let AxiosHeaders$2 = class AxiosHeaders {
7033
7033
  const self = this;
7034
7034
  const headers = {};
7035
7035
 
7036
- utils$1.forEach(this, (value, header) => {
7037
- const key = utils$1.findKey(headers, header);
7036
+ utils$1$1.forEach(this, (value, header) => {
7037
+ const key = utils$1$1.findKey(headers, header);
7038
7038
 
7039
7039
  if (key) {
7040
7040
  self[key] = normalizeValue$1(value);
@@ -7063,8 +7063,8 @@ let AxiosHeaders$2 = class AxiosHeaders {
7063
7063
  toJSON(asStrings) {
7064
7064
  const obj = Object.create(null);
7065
7065
 
7066
- utils$1.forEach(this, (value, header) => {
7067
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
7066
+ utils$1$1.forEach(this, (value, header) => {
7067
+ value != null && value !== false && (obj[header] = asStrings && utils$1$1.isArray(value) ? value.join(', ') : value);
7068
7068
  });
7069
7069
 
7070
7070
  return obj;
@@ -7111,7 +7111,7 @@ let AxiosHeaders$2 = class AxiosHeaders {
7111
7111
  }
7112
7112
  }
7113
7113
 
7114
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
7114
+ utils$1$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
7115
7115
 
7116
7116
  return this;
7117
7117
  }
@@ -7119,8 +7119,18 @@ let AxiosHeaders$2 = class AxiosHeaders {
7119
7119
 
7120
7120
  AxiosHeaders$2.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
7121
7121
 
7122
- utils$1.freezeMethods(AxiosHeaders$2.prototype);
7123
- utils$1.freezeMethods(AxiosHeaders$2);
7122
+ // reserved names hotfix
7123
+ utils$1$1.reduceDescriptors(AxiosHeaders$2.prototype, ({value}, key) => {
7124
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
7125
+ return {
7126
+ get: () => value,
7127
+ set(headerValue) {
7128
+ this[mapped] = headerValue;
7129
+ }
7130
+ }
7131
+ });
7132
+
7133
+ utils$1$1.freezeMethods(AxiosHeaders$2);
7124
7134
 
7125
7135
  var AxiosHeaders$1$1 = AxiosHeaders$2;
7126
7136
 
@@ -7138,7 +7148,7 @@ function transformData$1(fns, response) {
7138
7148
  const headers = AxiosHeaders$1$1.from(context.headers);
7139
7149
  let data = context.data;
7140
7150
 
7141
- utils$1.forEach(fns, function transform(fn) {
7151
+ utils$1$1.forEach(fns, function transform(fn) {
7142
7152
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
7143
7153
  });
7144
7154
 
@@ -7166,7 +7176,7 @@ function CanceledError$1(message, config, request) {
7166
7176
  this.name = 'CanceledError';
7167
7177
  }
7168
7178
 
7169
- utils$1.inherits(CanceledError$1, AxiosError$1, {
7179
+ utils$1$1.inherits(CanceledError$1, AxiosError$1, {
7170
7180
  __CANCEL__: true
7171
7181
  });
7172
7182
 
@@ -7194,53 +7204,44 @@ function settle$1(resolve, reject, response) {
7194
7204
  }
7195
7205
  }
7196
7206
 
7197
- var cookies$1 = platform$1.isStandardBrowserEnv ?
7207
+ var cookies$1 = platform$2.hasStandardBrowserEnv ?
7198
7208
 
7199
- // Standard browser envs support document.cookie
7200
- (function standardBrowserEnv() {
7201
- return {
7202
- write: function write(name, value, expires, path, domain, secure) {
7203
- const cookie = [];
7204
- cookie.push(name + '=' + encodeURIComponent(value));
7209
+ // Standard browser envs support document.cookie
7210
+ {
7211
+ write(name, value, expires, path, domain, secure) {
7212
+ const cookie = [name + '=' + encodeURIComponent(value)];
7205
7213
 
7206
- if (utils$1.isNumber(expires)) {
7207
- cookie.push('expires=' + new Date(expires).toGMTString());
7208
- }
7214
+ utils$1$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
7209
7215
 
7210
- if (utils$1.isString(path)) {
7211
- cookie.push('path=' + path);
7212
- }
7216
+ utils$1$1.isString(path) && cookie.push('path=' + path);
7213
7217
 
7214
- if (utils$1.isString(domain)) {
7215
- cookie.push('domain=' + domain);
7216
- }
7218
+ utils$1$1.isString(domain) && cookie.push('domain=' + domain);
7217
7219
 
7218
- if (secure === true) {
7219
- cookie.push('secure');
7220
- }
7220
+ secure === true && cookie.push('secure');
7221
7221
 
7222
- document.cookie = cookie.join('; ');
7223
- },
7222
+ document.cookie = cookie.join('; ');
7223
+ },
7224
7224
 
7225
- read: function read(name) {
7226
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
7227
- return (match ? decodeURIComponent(match[3]) : null);
7228
- },
7225
+ read(name) {
7226
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
7227
+ return (match ? decodeURIComponent(match[3]) : null);
7228
+ },
7229
7229
 
7230
- remove: function remove(name) {
7231
- this.write(name, '', Date.now() - 86400000);
7232
- }
7233
- };
7234
- })() :
7230
+ remove(name) {
7231
+ this.write(name, '', Date.now() - 86400000);
7232
+ }
7233
+ }
7235
7234
 
7236
- // Non standard browser env (web workers, react-native) lack needed support.
7237
- (function nonStandardBrowserEnv() {
7238
- return {
7239
- write: function write() {},
7240
- read: function read() { return null; },
7241
- remove: function remove() {}
7242
- };
7243
- })();
7235
+ :
7236
+
7237
+ // Non-standard browser env (web workers, react-native) lack needed support.
7238
+ {
7239
+ write() {},
7240
+ read() {
7241
+ return null;
7242
+ },
7243
+ remove() {}
7244
+ };
7244
7245
 
7245
7246
  /**
7246
7247
  * Determines whether the specified URL is absolute
@@ -7266,7 +7267,7 @@ function isAbsoluteURL$1(url) {
7266
7267
  */
7267
7268
  function combineURLs$1(baseURL, relativeURL) {
7268
7269
  return relativeURL
7269
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
7270
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
7270
7271
  : baseURL;
7271
7272
  }
7272
7273
 
@@ -7287,7 +7288,7 @@ function buildFullPath$1(baseURL, requestedURL) {
7287
7288
  return requestedURL;
7288
7289
  }
7289
7290
 
7290
- var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
7291
+ var isURLSameOrigin$1 = platform$2.hasStandardBrowserEnv ?
7291
7292
 
7292
7293
  // Standard browser envs have full support of the APIs needed to test
7293
7294
  // whether the request URL is of the same origin as current location.
@@ -7297,7 +7298,7 @@ var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
7297
7298
  let originURL;
7298
7299
 
7299
7300
  /**
7300
- * Parse a URL to discover it's components
7301
+ * Parse a URL to discover its components
7301
7302
  *
7302
7303
  * @param {String} url The URL to be parsed
7303
7304
  * @returns {Object}
@@ -7337,7 +7338,7 @@ var isURLSameOrigin$1 = platform$1.isStandardBrowserEnv ?
7337
7338
  * @returns {boolean} True if URL shares the same origin, otherwise false
7338
7339
  */
7339
7340
  return function isURLSameOrigin(requestURL) {
7340
- const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
7341
+ const parsed = (utils$1$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
7341
7342
  return (parsed.protocol === originURL.protocol &&
7342
7343
  parsed.host === originURL.host);
7343
7344
  };
@@ -7442,7 +7443,7 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7442
7443
  return new Promise(function dispatchXhrRequest(resolve, reject) {
7443
7444
  let requestData = config.data;
7444
7445
  const requestHeaders = AxiosHeaders$1$1.from(config.headers).normalize();
7445
- const responseType = config.responseType;
7446
+ let {responseType, withXSRFToken} = config;
7446
7447
  let onCanceled;
7447
7448
  function done() {
7448
7449
  if (config.cancelToken) {
@@ -7454,11 +7455,15 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7454
7455
  }
7455
7456
  }
7456
7457
 
7457
- if (utils$1.isFormData(requestData)) {
7458
- if (platform$1.isStandardBrowserEnv || platform$1.isStandardBrowserWebWorkerEnv) {
7458
+ let contentType;
7459
+
7460
+ if (utils$1$1.isFormData(requestData)) {
7461
+ if (platform$2.hasStandardBrowserEnv || platform$2.hasStandardBrowserWebWorkerEnv) {
7459
7462
  requestHeaders.setContentType(false); // Let the browser set it
7460
- } else {
7461
- requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
7463
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
7464
+ // fix semicolon duplication issue for ReactNative FormData implementation
7465
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
7466
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
7462
7467
  }
7463
7468
  }
7464
7469
 
@@ -7574,13 +7579,16 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7574
7579
  // Add xsrf header
7575
7580
  // This is only done if running in a standard browser environment.
7576
7581
  // Specifically not if we're in a web worker, or react-native.
7577
- if (platform$1.isStandardBrowserEnv) {
7578
- // Add xsrf header
7579
- const xsrfValue = (config.withCredentials || isURLSameOrigin$1(fullPath))
7580
- && config.xsrfCookieName && cookies$1.read(config.xsrfCookieName);
7582
+ if(platform$2.hasStandardBrowserEnv) {
7583
+ withXSRFToken && utils$1$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
7584
+
7585
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin$1(fullPath))) {
7586
+ // Add xsrf header
7587
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies$1.read(config.xsrfCookieName);
7581
7588
 
7582
- if (xsrfValue) {
7583
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
7589
+ if (xsrfValue) {
7590
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
7591
+ }
7584
7592
  }
7585
7593
  }
7586
7594
 
@@ -7589,13 +7597,13 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7589
7597
 
7590
7598
  // Add headers to the request
7591
7599
  if ('setRequestHeader' in request) {
7592
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
7600
+ utils$1$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
7593
7601
  request.setRequestHeader(key, val);
7594
7602
  });
7595
7603
  }
7596
7604
 
7597
7605
  // Add withCredentials to request if needed
7598
- if (!utils$1.isUndefined(config.withCredentials)) {
7606
+ if (!utils$1$1.isUndefined(config.withCredentials)) {
7599
7607
  request.withCredentials = !!config.withCredentials;
7600
7608
  }
7601
7609
 
@@ -7634,7 +7642,7 @@ var xhrAdapter$1 = isXHRAdapterSupported$1 && function (config) {
7634
7642
 
7635
7643
  const protocol = parseProtocol$1(fullPath);
7636
7644
 
7637
- if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
7645
+ if (protocol && platform$2.protocols.indexOf(protocol) === -1) {
7638
7646
  reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
7639
7647
  return;
7640
7648
  }
@@ -7650,8 +7658,8 @@ const knownAdapters$1 = {
7650
7658
  xhr: xhrAdapter$1
7651
7659
  };
7652
7660
 
7653
- utils$1.forEach(knownAdapters$1, (fn, value) => {
7654
- if(fn) {
7661
+ utils$1$1.forEach(knownAdapters$1, (fn, value) => {
7662
+ if (fn) {
7655
7663
  try {
7656
7664
  Object.defineProperty(fn, 'name', {value});
7657
7665
  } catch (e) {
@@ -7661,38 +7669,56 @@ utils$1.forEach(knownAdapters$1, (fn, value) => {
7661
7669
  }
7662
7670
  });
7663
7671
 
7672
+ const renderReason$1 = (reason) => `- ${reason}`;
7673
+
7674
+ const isResolvedHandle$1 = (adapter) => utils$1$1.isFunction(adapter) || adapter === null || adapter === false;
7675
+
7664
7676
  var adapters$1 = {
7665
7677
  getAdapter: (adapters) => {
7666
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
7678
+ adapters = utils$1$1.isArray(adapters) ? adapters : [adapters];
7667
7679
 
7668
7680
  const {length} = adapters;
7669
7681
  let nameOrAdapter;
7670
7682
  let adapter;
7671
7683
 
7684
+ const rejectedReasons = {};
7685
+
7672
7686
  for (let i = 0; i < length; i++) {
7673
7687
  nameOrAdapter = adapters[i];
7674
- if((adapter = utils$1.isString(nameOrAdapter) ? knownAdapters$1[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
7688
+ let id;
7689
+
7690
+ adapter = nameOrAdapter;
7691
+
7692
+ if (!isResolvedHandle$1(nameOrAdapter)) {
7693
+ adapter = knownAdapters$1[(id = String(nameOrAdapter)).toLowerCase()];
7694
+
7695
+ if (adapter === undefined) {
7696
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
7697
+ }
7698
+ }
7699
+
7700
+ if (adapter) {
7675
7701
  break;
7676
7702
  }
7703
+
7704
+ rejectedReasons[id || '#' + i] = adapter;
7677
7705
  }
7678
7706
 
7679
7707
  if (!adapter) {
7680
- if (adapter === false) {
7681
- throw new AxiosError$1(
7682
- `Adapter ${nameOrAdapter} is not supported by the environment`,
7683
- 'ERR_NOT_SUPPORT'
7708
+
7709
+ const reasons = Object.entries(rejectedReasons)
7710
+ .map(([id, state]) => `adapter ${id} ` +
7711
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
7684
7712
  );
7685
- }
7686
7713
 
7687
- throw new Error(
7688
- utils$1.hasOwnProp(knownAdapters$1, nameOrAdapter) ?
7689
- `Adapter '${nameOrAdapter}' is not available in the build` :
7690
- `Unknown adapter '${nameOrAdapter}'`
7691
- );
7692
- }
7714
+ let s = length ?
7715
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason$1).join('\n') : ' ' + renderReason$1(reasons[0])) :
7716
+ 'as no adapter specified';
7693
7717
 
7694
- if (!utils$1.isFunction(adapter)) {
7695
- throw new TypeError('adapter is not a function');
7718
+ throw new AxiosError$1(
7719
+ `There is no suitable adapter to dispatch the request ` + s,
7720
+ 'ERR_NOT_SUPPORT'
7721
+ );
7696
7722
  }
7697
7723
 
7698
7724
  return adapter;
@@ -7790,11 +7816,11 @@ function mergeConfig$1(config1, config2) {
7790
7816
  const config = {};
7791
7817
 
7792
7818
  function getMergedValue(target, source, caseless) {
7793
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
7794
- return utils$1.merge.call({caseless}, target, source);
7795
- } else if (utils$1.isPlainObject(source)) {
7796
- return utils$1.merge({}, source);
7797
- } else if (utils$1.isArray(source)) {
7819
+ if (utils$1$1.isPlainObject(target) && utils$1$1.isPlainObject(source)) {
7820
+ return utils$1$1.merge.call({caseless}, target, source);
7821
+ } else if (utils$1$1.isPlainObject(source)) {
7822
+ return utils$1$1.merge({}, source);
7823
+ } else if (utils$1$1.isArray(source)) {
7798
7824
  return source.slice();
7799
7825
  }
7800
7826
  return source;
@@ -7802,25 +7828,25 @@ function mergeConfig$1(config1, config2) {
7802
7828
 
7803
7829
  // eslint-disable-next-line consistent-return
7804
7830
  function mergeDeepProperties(a, b, caseless) {
7805
- if (!utils$1.isUndefined(b)) {
7831
+ if (!utils$1$1.isUndefined(b)) {
7806
7832
  return getMergedValue(a, b, caseless);
7807
- } else if (!utils$1.isUndefined(a)) {
7833
+ } else if (!utils$1$1.isUndefined(a)) {
7808
7834
  return getMergedValue(undefined, a, caseless);
7809
7835
  }
7810
7836
  }
7811
7837
 
7812
7838
  // eslint-disable-next-line consistent-return
7813
7839
  function valueFromConfig2(a, b) {
7814
- if (!utils$1.isUndefined(b)) {
7840
+ if (!utils$1$1.isUndefined(b)) {
7815
7841
  return getMergedValue(undefined, b);
7816
7842
  }
7817
7843
  }
7818
7844
 
7819
7845
  // eslint-disable-next-line consistent-return
7820
7846
  function defaultToConfig2(a, b) {
7821
- if (!utils$1.isUndefined(b)) {
7847
+ if (!utils$1$1.isUndefined(b)) {
7822
7848
  return getMergedValue(undefined, b);
7823
- } else if (!utils$1.isUndefined(a)) {
7849
+ } else if (!utils$1$1.isUndefined(a)) {
7824
7850
  return getMergedValue(undefined, a);
7825
7851
  }
7826
7852
  }
@@ -7845,6 +7871,7 @@ function mergeConfig$1(config1, config2) {
7845
7871
  timeout: defaultToConfig2,
7846
7872
  timeoutMessage: defaultToConfig2,
7847
7873
  withCredentials: defaultToConfig2,
7874
+ withXSRFToken: defaultToConfig2,
7848
7875
  adapter: defaultToConfig2,
7849
7876
  responseType: defaultToConfig2,
7850
7877
  xsrfCookieName: defaultToConfig2,
@@ -7865,16 +7892,16 @@ function mergeConfig$1(config1, config2) {
7865
7892
  headers: (a, b) => mergeDeepProperties(headersToObject$1(a), headersToObject$1(b), true)
7866
7893
  };
7867
7894
 
7868
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
7895
+ utils$1$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
7869
7896
  const merge = mergeMap[prop] || mergeDeepProperties;
7870
7897
  const configValue = merge(config1[prop], config2[prop], prop);
7871
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
7898
+ (utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
7872
7899
  });
7873
7900
 
7874
7901
  return config;
7875
7902
  }
7876
7903
 
7877
- const VERSION$1 = "1.4.0";
7904
+ const VERSION$1 = "1.6.5";
7878
7905
 
7879
7906
  const validators$1$1 = {};
7880
7907
 
@@ -8012,7 +8039,7 @@ let Axios$2 = class Axios {
8012
8039
  }
8013
8040
 
8014
8041
  if (paramsSerializer != null) {
8015
- if (utils$1.isFunction(paramsSerializer)) {
8042
+ if (utils$1$1.isFunction(paramsSerializer)) {
8016
8043
  config.paramsSerializer = {
8017
8044
  serialize: paramsSerializer
8018
8045
  };
@@ -8027,15 +8054,13 @@ let Axios$2 = class Axios {
8027
8054
  // Set config.method
8028
8055
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
8029
8056
 
8030
- let contextHeaders;
8031
-
8032
8057
  // Flatten headers
8033
- contextHeaders = headers && utils$1.merge(
8058
+ let contextHeaders = headers && utils$1$1.merge(
8034
8059
  headers.common,
8035
8060
  headers[config.method]
8036
8061
  );
8037
8062
 
8038
- contextHeaders && utils$1.forEach(
8063
+ headers && utils$1$1.forEach(
8039
8064
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
8040
8065
  (method) => {
8041
8066
  delete headers[method];
@@ -8122,7 +8147,7 @@ let Axios$2 = class Axios {
8122
8147
  };
8123
8148
 
8124
8149
  // Provide aliases for supported request methods
8125
- utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
8150
+ utils$1$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
8126
8151
  /*eslint func-names:0*/
8127
8152
  Axios$2.prototype[method] = function(url, config) {
8128
8153
  return this.request(mergeConfig$1(config || {}, {
@@ -8133,7 +8158,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
8133
8158
  };
8134
8159
  });
8135
8160
 
8136
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
8161
+ utils$1$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
8137
8162
  /*eslint func-names:0*/
8138
8163
 
8139
8164
  function generateHTTPMethod(isForm) {
@@ -8309,7 +8334,7 @@ function spread$1(callback) {
8309
8334
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
8310
8335
  */
8311
8336
  function isAxiosError$1(payload) {
8312
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
8337
+ return utils$1$1.isObject(payload) && (payload.isAxiosError === true);
8313
8338
  }
8314
8339
 
8315
8340
  const HttpStatusCode$2 = {
@@ -8396,10 +8421,10 @@ function createInstance$1(defaultConfig) {
8396
8421
  const instance = bind$1(Axios$1$1.prototype.request, context);
8397
8422
 
8398
8423
  // Copy axios.prototype to instance
8399
- utils$1.extend(instance, Axios$1$1.prototype, context, {allOwnKeys: true});
8424
+ utils$1$1.extend(instance, Axios$1$1.prototype, context, {allOwnKeys: true});
8400
8425
 
8401
8426
  // Copy context to instance
8402
- utils$1.extend(instance, context, null, {allOwnKeys: true});
8427
+ utils$1$1.extend(instance, context, null, {allOwnKeys: true});
8403
8428
 
8404
8429
  // Factory for creating new instances
8405
8430
  instance.create = function create(instanceConfig) {
@@ -8443,7 +8468,9 @@ axios$2.mergeConfig = mergeConfig$1;
8443
8468
 
8444
8469
  axios$2.AxiosHeaders = AxiosHeaders$1$1;
8445
8470
 
8446
- axios$2.formToJSON = thing => formDataToJSON$1(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
8471
+ axios$2.formToJSON = thing => formDataToJSON$1(utils$1$1.isHTMLForm(thing) ? new FormData(thing) : thing);
8472
+
8473
+ axios$2.getAdapter = adapters$1.getAdapter;
8447
8474
 
8448
8475
  axios$2.HttpStatusCode = HttpStatusCode$1$1;
8449
8476
 
@@ -10562,7 +10589,7 @@ class PassportConfiguration {
10562
10589
  this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
10563
10590
  this.passportDomain = 'https://passport.immutable.com';
10564
10591
  this.imxPublicApiDomain = 'https://api.immutable.com';
10565
- this.zkEvmRpcUrl = ''; // TODO: ID-785 Update once mainnet has been deployed
10592
+ this.zkEvmRpcUrl = 'https://rpc.immutable.com';
10566
10593
  this.relayerUrl = 'https://api.immutable.com/relayer-mr';
10567
10594
  this.multiRollupConfig = multiRollupConfig.getProduction();
10568
10595
  break;
@@ -14804,8 +14831,9 @@ const reduceDescriptors = (obj, reducer) => {
14804
14831
  const reducedDescriptors = {};
14805
14832
 
14806
14833
  forEach(descriptors, (descriptor, name) => {
14807
- if (reducer(descriptor, name, obj) !== false) {
14808
- reducedDescriptors[name] = descriptor;
14834
+ let ret;
14835
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
14836
+ reducedDescriptors[name] = ret || descriptor;
14809
14837
  }
14810
14838
  });
14811
14839
 
@@ -14931,7 +14959,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
14931
14959
  const isThenable = (thing) =>
14932
14960
  thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
14933
14961
 
14934
- var utils = {
14962
+ var utils$1 = {
14935
14963
  isArray,
14936
14964
  isArrayBuffer,
14937
14965
  isBuffer,
@@ -15013,7 +15041,7 @@ function AxiosError(message, code, config, request, response) {
15013
15041
  response && (this.response = response);
15014
15042
  }
15015
15043
 
15016
- utils.inherits(AxiosError, Error, {
15044
+ utils$1.inherits(AxiosError, Error, {
15017
15045
  toJSON: function toJSON() {
15018
15046
  return {
15019
15047
  // Standard
@@ -15028,7 +15056,7 @@ utils.inherits(AxiosError, Error, {
15028
15056
  columnNumber: this.columnNumber,
15029
15057
  stack: this.stack,
15030
15058
  // Axios
15031
- config: utils.toJSONObject(this.config),
15059
+ config: utils$1.toJSONObject(this.config),
15032
15060
  code: this.code,
15033
15061
  status: this.response && this.response.status ? this.response.status : null
15034
15062
  };
@@ -15063,7 +15091,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
15063
15091
  AxiosError.from = (error, code, config, request, response, customProps) => {
15064
15092
  const axiosError = Object.create(prototype$1);
15065
15093
 
15066
- utils.toFlatObject(error, axiosError, function filter(obj) {
15094
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
15067
15095
  return obj !== Error.prototype;
15068
15096
  }, prop => {
15069
15097
  return prop !== 'isAxiosError';
@@ -15091,7 +15119,7 @@ var httpAdapter = null;
15091
15119
  * @returns {boolean}
15092
15120
  */
15093
15121
  function isVisitable(thing) {
15094
- return utils.isPlainObject(thing) || utils.isArray(thing);
15122
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
15095
15123
  }
15096
15124
 
15097
15125
  /**
@@ -15102,7 +15130,7 @@ function isVisitable(thing) {
15102
15130
  * @returns {string} the key without the brackets.
15103
15131
  */
15104
15132
  function removeBrackets(key) {
15105
- return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
15133
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
15106
15134
  }
15107
15135
 
15108
15136
  /**
@@ -15131,10 +15159,10 @@ function renderKey(path, key, dots) {
15131
15159
  * @returns {boolean}
15132
15160
  */
15133
15161
  function isFlatArray(arr) {
15134
- return utils.isArray(arr) && !arr.some(isVisitable);
15162
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
15135
15163
  }
15136
15164
 
15137
- const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
15165
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
15138
15166
  return /^is[A-Z]/.test(prop);
15139
15167
  });
15140
15168
 
@@ -15162,7 +15190,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
15162
15190
  * @returns
15163
15191
  */
15164
15192
  function toFormData(obj, formData, options) {
15165
- if (!utils.isObject(obj)) {
15193
+ if (!utils$1.isObject(obj)) {
15166
15194
  throw new TypeError('target must be an object');
15167
15195
  }
15168
15196
 
@@ -15170,13 +15198,13 @@ function toFormData(obj, formData, options) {
15170
15198
  formData = formData || new (FormData)();
15171
15199
 
15172
15200
  // eslint-disable-next-line no-param-reassign
15173
- options = utils.toFlatObject(options, {
15201
+ options = utils$1.toFlatObject(options, {
15174
15202
  metaTokens: true,
15175
15203
  dots: false,
15176
15204
  indexes: false
15177
15205
  }, false, function defined(option, source) {
15178
15206
  // eslint-disable-next-line no-eq-null,eqeqeq
15179
- return !utils.isUndefined(source[option]);
15207
+ return !utils$1.isUndefined(source[option]);
15180
15208
  });
15181
15209
 
15182
15210
  const metaTokens = options.metaTokens;
@@ -15185,24 +15213,24 @@ function toFormData(obj, formData, options) {
15185
15213
  const dots = options.dots;
15186
15214
  const indexes = options.indexes;
15187
15215
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
15188
- const useBlob = _Blob && utils.isSpecCompliantForm(formData);
15216
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
15189
15217
 
15190
- if (!utils.isFunction(visitor)) {
15218
+ if (!utils$1.isFunction(visitor)) {
15191
15219
  throw new TypeError('visitor must be a function');
15192
15220
  }
15193
15221
 
15194
15222
  function convertValue(value) {
15195
15223
  if (value === null) return '';
15196
15224
 
15197
- if (utils.isDate(value)) {
15225
+ if (utils$1.isDate(value)) {
15198
15226
  return value.toISOString();
15199
15227
  }
15200
15228
 
15201
- if (!useBlob && utils.isBlob(value)) {
15229
+ if (!useBlob && utils$1.isBlob(value)) {
15202
15230
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
15203
15231
  }
15204
15232
 
15205
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
15233
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
15206
15234
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
15207
15235
  }
15208
15236
 
@@ -15223,20 +15251,20 @@ function toFormData(obj, formData, options) {
15223
15251
  let arr = value;
15224
15252
 
15225
15253
  if (value && !path && typeof value === 'object') {
15226
- if (utils.endsWith(key, '{}')) {
15254
+ if (utils$1.endsWith(key, '{}')) {
15227
15255
  // eslint-disable-next-line no-param-reassign
15228
15256
  key = metaTokens ? key : key.slice(0, -2);
15229
15257
  // eslint-disable-next-line no-param-reassign
15230
15258
  value = JSON.stringify(value);
15231
15259
  } else if (
15232
- (utils.isArray(value) && isFlatArray(value)) ||
15233
- ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
15260
+ (utils$1.isArray(value) && isFlatArray(value)) ||
15261
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
15234
15262
  )) {
15235
15263
  // eslint-disable-next-line no-param-reassign
15236
15264
  key = removeBrackets(key);
15237
15265
 
15238
15266
  arr.forEach(function each(el, index) {
15239
- !(utils.isUndefined(el) || el === null) && formData.append(
15267
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
15240
15268
  // eslint-disable-next-line no-nested-ternary
15241
15269
  indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
15242
15270
  convertValue(el)
@@ -15264,7 +15292,7 @@ function toFormData(obj, formData, options) {
15264
15292
  });
15265
15293
 
15266
15294
  function build(value, path) {
15267
- if (utils.isUndefined(value)) return;
15295
+ if (utils$1.isUndefined(value)) return;
15268
15296
 
15269
15297
  if (stack.indexOf(value) !== -1) {
15270
15298
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -15272,9 +15300,9 @@ function toFormData(obj, formData, options) {
15272
15300
 
15273
15301
  stack.push(value);
15274
15302
 
15275
- utils.forEach(value, function each(el, key) {
15276
- const result = !(utils.isUndefined(el) || el === null) && visitor.call(
15277
- formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
15303
+ utils$1.forEach(value, function each(el, key) {
15304
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
15305
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
15278
15306
  );
15279
15307
 
15280
15308
  if (result === true) {
@@ -15285,7 +15313,7 @@ function toFormData(obj, formData, options) {
15285
15313
  stack.pop();
15286
15314
  }
15287
15315
 
15288
- if (!utils.isObject(obj)) {
15316
+ if (!utils$1.isObject(obj)) {
15289
15317
  throw new TypeError('data must be an object');
15290
15318
  }
15291
15319
 
@@ -15389,7 +15417,7 @@ function buildURL(url, params, options) {
15389
15417
  if (serializeFn) {
15390
15418
  serializedParams = serializeFn(params, options);
15391
15419
  } else {
15392
- serializedParams = utils.isURLSearchParams(params) ?
15420
+ serializedParams = utils$1.isURLSearchParams(params) ?
15393
15421
  params.toString() :
15394
15422
  new AxiosURLSearchParams(params, options).toString(_encode);
15395
15423
  }
@@ -15464,7 +15492,7 @@ class InterceptorManager {
15464
15492
  * @returns {void}
15465
15493
  */
15466
15494
  forEach(fn) {
15467
- utils.forEach(this.handlers, function forEachHandler(h) {
15495
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
15468
15496
  if (h !== null) {
15469
15497
  fn(h);
15470
15498
  }
@@ -15486,6 +15514,18 @@ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15486
15514
 
15487
15515
  var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15488
15516
 
15517
+ var platform$1 = {
15518
+ isBrowser: true,
15519
+ classes: {
15520
+ URLSearchParams: URLSearchParams$1,
15521
+ FormData: FormData$1,
15522
+ Blob: Blob$1
15523
+ },
15524
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
15525
+ };
15526
+
15527
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15528
+
15489
15529
  /**
15490
15530
  * Determine if we're running in a standard browser environment
15491
15531
  *
@@ -15503,18 +15543,10 @@ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15503
15543
  *
15504
15544
  * @returns {boolean}
15505
15545
  */
15506
- const isStandardBrowserEnv = (() => {
15507
- let product;
15508
- if (typeof navigator !== 'undefined' && (
15509
- (product = navigator.product) === 'ReactNative' ||
15510
- product === 'NativeScript' ||
15511
- product === 'NS')
15512
- ) {
15513
- return false;
15514
- }
15515
-
15516
- return typeof window !== 'undefined' && typeof document !== 'undefined';
15517
- })();
15546
+ const hasStandardBrowserEnv = (
15547
+ (product) => {
15548
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
15549
+ })(typeof navigator !== 'undefined' && navigator.product);
15518
15550
 
15519
15551
  /**
15520
15552
  * Determine if we're running in a standard browser webWorker environment
@@ -15525,7 +15557,7 @@ const isStandardBrowserEnv = (() => {
15525
15557
  * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15526
15558
  * This leads to a problem when axios post `FormData` in webWorker
15527
15559
  */
15528
- const isStandardBrowserWebWorkerEnv = (() => {
15560
+ const hasStandardBrowserWebWorkerEnv = (() => {
15529
15561
  return (
15530
15562
  typeof WorkerGlobalScope !== 'undefined' &&
15531
15563
  // eslint-disable-next-line no-undef
@@ -15534,23 +15566,22 @@ const isStandardBrowserEnv = (() => {
15534
15566
  );
15535
15567
  })();
15536
15568
 
15569
+ var utils = /*#__PURE__*/Object.freeze({
15570
+ __proto__: null,
15571
+ hasBrowserEnv: hasBrowserEnv,
15572
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
15573
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv
15574
+ });
15537
15575
 
15538
15576
  var platform = {
15539
- isBrowser: true,
15540
- classes: {
15541
- URLSearchParams: URLSearchParams$1,
15542
- FormData: FormData$1,
15543
- Blob: Blob$1
15544
- },
15545
- isStandardBrowserEnv,
15546
- isStandardBrowserWebWorkerEnv,
15547
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
15577
+ ...utils,
15578
+ ...platform$1
15548
15579
  };
15549
15580
 
15550
15581
  function toURLEncodedForm(data, options) {
15551
15582
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
15552
15583
  visitor: function(value, key, path, helpers) {
15553
- if (platform.isNode && utils.isBuffer(value)) {
15584
+ if (platform.isNode && utils$1.isBuffer(value)) {
15554
15585
  this.append(key, value.toString('base64'));
15555
15586
  return false;
15556
15587
  }
@@ -15572,7 +15603,7 @@ function parsePropPath(name) {
15572
15603
  // foo.x.y.z
15573
15604
  // foo-x-y-z
15574
15605
  // foo x y z
15575
- return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
15606
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
15576
15607
  return match[0] === '[]' ? '' : match[1] || match[0];
15577
15608
  });
15578
15609
  }
@@ -15607,12 +15638,15 @@ function arrayToObject(arr) {
15607
15638
  function formDataToJSON(formData) {
15608
15639
  function buildPath(path, value, target, index) {
15609
15640
  let name = path[index++];
15641
+
15642
+ if (name === '__proto__') return true;
15643
+
15610
15644
  const isNumericKey = Number.isFinite(+name);
15611
15645
  const isLast = index >= path.length;
15612
- name = !name && utils.isArray(target) ? target.length : name;
15646
+ name = !name && utils$1.isArray(target) ? target.length : name;
15613
15647
 
15614
15648
  if (isLast) {
15615
- if (utils.hasOwnProp(target, name)) {
15649
+ if (utils$1.hasOwnProp(target, name)) {
15616
15650
  target[name] = [target[name], value];
15617
15651
  } else {
15618
15652
  target[name] = value;
@@ -15621,23 +15655,23 @@ function formDataToJSON(formData) {
15621
15655
  return !isNumericKey;
15622
15656
  }
15623
15657
 
15624
- if (!target[name] || !utils.isObject(target[name])) {
15658
+ if (!target[name] || !utils$1.isObject(target[name])) {
15625
15659
  target[name] = [];
15626
15660
  }
15627
15661
 
15628
15662
  const result = buildPath(path, value, target[name], index);
15629
15663
 
15630
- if (result && utils.isArray(target[name])) {
15664
+ if (result && utils$1.isArray(target[name])) {
15631
15665
  target[name] = arrayToObject(target[name]);
15632
15666
  }
15633
15667
 
15634
15668
  return !isNumericKey;
15635
15669
  }
15636
15670
 
15637
- if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
15671
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
15638
15672
  const obj = {};
15639
15673
 
15640
- utils.forEachEntry(formData, (name, value) => {
15674
+ utils$1.forEachEntry(formData, (name, value) => {
15641
15675
  buildPath(parsePropPath(name), value, obj, 0);
15642
15676
  });
15643
15677
 
@@ -15647,10 +15681,6 @@ function formDataToJSON(formData) {
15647
15681
  return null;
15648
15682
  }
15649
15683
 
15650
- const DEFAULT_CONTENT_TYPE = {
15651
- 'Content-Type': undefined
15652
- };
15653
-
15654
15684
  /**
15655
15685
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
15656
15686
  * of the input
@@ -15662,10 +15692,10 @@ const DEFAULT_CONTENT_TYPE = {
15662
15692
  * @returns {string} A stringified version of the rawValue.
15663
15693
  */
15664
15694
  function stringifySafely(rawValue, parser, encoder) {
15665
- if (utils.isString(rawValue)) {
15695
+ if (utils$1.isString(rawValue)) {
15666
15696
  try {
15667
15697
  (parser || JSON.parse)(rawValue);
15668
- return utils.trim(rawValue);
15698
+ return utils$1.trim(rawValue);
15669
15699
  } catch (e) {
15670
15700
  if (e.name !== 'SyntaxError') {
15671
15701
  throw e;
@@ -15685,13 +15715,13 @@ const defaults = {
15685
15715
  transformRequest: [function transformRequest(data, headers) {
15686
15716
  const contentType = headers.getContentType() || '';
15687
15717
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
15688
- const isObjectPayload = utils.isObject(data);
15718
+ const isObjectPayload = utils$1.isObject(data);
15689
15719
 
15690
- if (isObjectPayload && utils.isHTMLForm(data)) {
15720
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
15691
15721
  data = new FormData(data);
15692
15722
  }
15693
15723
 
15694
- const isFormData = utils.isFormData(data);
15724
+ const isFormData = utils$1.isFormData(data);
15695
15725
 
15696
15726
  if (isFormData) {
15697
15727
  if (!hasJSONContentType) {
@@ -15700,18 +15730,18 @@ const defaults = {
15700
15730
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
15701
15731
  }
15702
15732
 
15703
- if (utils.isArrayBuffer(data) ||
15704
- utils.isBuffer(data) ||
15705
- utils.isStream(data) ||
15706
- utils.isFile(data) ||
15707
- utils.isBlob(data)
15733
+ if (utils$1.isArrayBuffer(data) ||
15734
+ utils$1.isBuffer(data) ||
15735
+ utils$1.isStream(data) ||
15736
+ utils$1.isFile(data) ||
15737
+ utils$1.isBlob(data)
15708
15738
  ) {
15709
15739
  return data;
15710
15740
  }
15711
- if (utils.isArrayBufferView(data)) {
15741
+ if (utils$1.isArrayBufferView(data)) {
15712
15742
  return data.buffer;
15713
15743
  }
15714
- if (utils.isURLSearchParams(data)) {
15744
+ if (utils$1.isURLSearchParams(data)) {
15715
15745
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
15716
15746
  return data.toString();
15717
15747
  }
@@ -15723,7 +15753,7 @@ const defaults = {
15723
15753
  return toURLEncodedForm(data, this.formSerializer).toString();
15724
15754
  }
15725
15755
 
15726
- if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
15756
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
15727
15757
  const _FormData = this.env && this.env.FormData;
15728
15758
 
15729
15759
  return toFormData(
@@ -15747,7 +15777,7 @@ const defaults = {
15747
15777
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
15748
15778
  const JSONRequested = this.responseType === 'json';
15749
15779
 
15750
- if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
15780
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
15751
15781
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
15752
15782
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
15753
15783
 
@@ -15789,24 +15819,21 @@ const defaults = {
15789
15819
 
15790
15820
  headers: {
15791
15821
  common: {
15792
- 'Accept': 'application/json, text/plain, */*'
15822
+ 'Accept': 'application/json, text/plain, */*',
15823
+ 'Content-Type': undefined
15793
15824
  }
15794
15825
  }
15795
15826
  };
15796
15827
 
15797
- utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
15828
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
15798
15829
  defaults.headers[method] = {};
15799
15830
  });
15800
15831
 
15801
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
15802
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
15803
- });
15804
-
15805
15832
  var defaults$1 = defaults;
15806
15833
 
15807
15834
  // RawAxiosHeaders whose duplicates are ignored by node
15808
15835
  // c.f. https://nodejs.org/api/http.html#http_message_headers
15809
- const ignoreDuplicateOf = utils.toObjectSet([
15836
+ const ignoreDuplicateOf = utils$1.toObjectSet([
15810
15837
  'age', 'authorization', 'content-length', 'content-type', 'etag',
15811
15838
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
15812
15839
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -15867,7 +15894,7 @@ function normalizeValue(value) {
15867
15894
  return value;
15868
15895
  }
15869
15896
 
15870
- return utils.isArray(value) ? value.map(normalizeValue) : String(value);
15897
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
15871
15898
  }
15872
15899
 
15873
15900
  function parseTokens(str) {
@@ -15885,7 +15912,7 @@ function parseTokens(str) {
15885
15912
  const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
15886
15913
 
15887
15914
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15888
- if (utils.isFunction(filter)) {
15915
+ if (utils$1.isFunction(filter)) {
15889
15916
  return filter.call(this, value, header);
15890
15917
  }
15891
15918
 
@@ -15893,13 +15920,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15893
15920
  value = header;
15894
15921
  }
15895
15922
 
15896
- if (!utils.isString(value)) return;
15923
+ if (!utils$1.isString(value)) return;
15897
15924
 
15898
- if (utils.isString(filter)) {
15925
+ if (utils$1.isString(filter)) {
15899
15926
  return value.indexOf(filter) !== -1;
15900
15927
  }
15901
15928
 
15902
- if (utils.isRegExp(filter)) {
15929
+ if (utils$1.isRegExp(filter)) {
15903
15930
  return filter.test(value);
15904
15931
  }
15905
15932
  }
@@ -15912,7 +15939,7 @@ function formatHeader(header) {
15912
15939
  }
15913
15940
 
15914
15941
  function buildAccessors(obj, header) {
15915
- const accessorName = utils.toCamelCase(' ' + header);
15942
+ const accessorName = utils$1.toCamelCase(' ' + header);
15916
15943
 
15917
15944
  ['get', 'set', 'has'].forEach(methodName => {
15918
15945
  Object.defineProperty(obj, methodName + accessorName, {
@@ -15939,7 +15966,7 @@ class AxiosHeaders {
15939
15966
  throw new Error('header name must be a non-empty string');
15940
15967
  }
15941
15968
 
15942
- const key = utils.findKey(self, lHeader);
15969
+ const key = utils$1.findKey(self, lHeader);
15943
15970
 
15944
15971
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
15945
15972
  self[key || _header] = normalizeValue(_value);
@@ -15947,11 +15974,11 @@ class AxiosHeaders {
15947
15974
  }
15948
15975
 
15949
15976
  const setHeaders = (headers, _rewrite) =>
15950
- utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15977
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15951
15978
 
15952
- if (utils.isPlainObject(header) || header instanceof this.constructor) {
15979
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
15953
15980
  setHeaders(header, valueOrRewrite);
15954
- } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15981
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15955
15982
  setHeaders(parseHeaders(header), valueOrRewrite);
15956
15983
  } else {
15957
15984
  header != null && setHeader(valueOrRewrite, header, rewrite);
@@ -15964,7 +15991,7 @@ class AxiosHeaders {
15964
15991
  header = normalizeHeader(header);
15965
15992
 
15966
15993
  if (header) {
15967
- const key = utils.findKey(this, header);
15994
+ const key = utils$1.findKey(this, header);
15968
15995
 
15969
15996
  if (key) {
15970
15997
  const value = this[key];
@@ -15977,11 +16004,11 @@ class AxiosHeaders {
15977
16004
  return parseTokens(value);
15978
16005
  }
15979
16006
 
15980
- if (utils.isFunction(parser)) {
16007
+ if (utils$1.isFunction(parser)) {
15981
16008
  return parser.call(this, value, key);
15982
16009
  }
15983
16010
 
15984
- if (utils.isRegExp(parser)) {
16011
+ if (utils$1.isRegExp(parser)) {
15985
16012
  return parser.exec(value);
15986
16013
  }
15987
16014
 
@@ -15994,7 +16021,7 @@ class AxiosHeaders {
15994
16021
  header = normalizeHeader(header);
15995
16022
 
15996
16023
  if (header) {
15997
- const key = utils.findKey(this, header);
16024
+ const key = utils$1.findKey(this, header);
15998
16025
 
15999
16026
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
16000
16027
  }
@@ -16010,7 +16037,7 @@ class AxiosHeaders {
16010
16037
  _header = normalizeHeader(_header);
16011
16038
 
16012
16039
  if (_header) {
16013
- const key = utils.findKey(self, _header);
16040
+ const key = utils$1.findKey(self, _header);
16014
16041
 
16015
16042
  if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
16016
16043
  delete self[key];
@@ -16020,7 +16047,7 @@ class AxiosHeaders {
16020
16047
  }
16021
16048
  }
16022
16049
 
16023
- if (utils.isArray(header)) {
16050
+ if (utils$1.isArray(header)) {
16024
16051
  header.forEach(deleteHeader);
16025
16052
  } else {
16026
16053
  deleteHeader(header);
@@ -16049,8 +16076,8 @@ class AxiosHeaders {
16049
16076
  const self = this;
16050
16077
  const headers = {};
16051
16078
 
16052
- utils.forEach(this, (value, header) => {
16053
- const key = utils.findKey(headers, header);
16079
+ utils$1.forEach(this, (value, header) => {
16080
+ const key = utils$1.findKey(headers, header);
16054
16081
 
16055
16082
  if (key) {
16056
16083
  self[key] = normalizeValue(value);
@@ -16079,8 +16106,8 @@ class AxiosHeaders {
16079
16106
  toJSON(asStrings) {
16080
16107
  const obj = Object.create(null);
16081
16108
 
16082
- utils.forEach(this, (value, header) => {
16083
- value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
16109
+ utils$1.forEach(this, (value, header) => {
16110
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
16084
16111
  });
16085
16112
 
16086
16113
  return obj;
@@ -16127,7 +16154,7 @@ class AxiosHeaders {
16127
16154
  }
16128
16155
  }
16129
16156
 
16130
- utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16157
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16131
16158
 
16132
16159
  return this;
16133
16160
  }
@@ -16135,8 +16162,18 @@ class AxiosHeaders {
16135
16162
 
16136
16163
  AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
16137
16164
 
16138
- utils.freezeMethods(AxiosHeaders.prototype);
16139
- utils.freezeMethods(AxiosHeaders);
16165
+ // reserved names hotfix
16166
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
16167
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
16168
+ return {
16169
+ get: () => value,
16170
+ set(headerValue) {
16171
+ this[mapped] = headerValue;
16172
+ }
16173
+ }
16174
+ });
16175
+
16176
+ utils$1.freezeMethods(AxiosHeaders);
16140
16177
 
16141
16178
  var AxiosHeaders$1 = AxiosHeaders;
16142
16179
 
@@ -16154,7 +16191,7 @@ function transformData(fns, response) {
16154
16191
  const headers = AxiosHeaders$1.from(context.headers);
16155
16192
  let data = context.data;
16156
16193
 
16157
- utils.forEach(fns, function transform(fn) {
16194
+ utils$1.forEach(fns, function transform(fn) {
16158
16195
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
16159
16196
  });
16160
16197
 
@@ -16182,7 +16219,7 @@ function CanceledError(message, config, request) {
16182
16219
  this.name = 'CanceledError';
16183
16220
  }
16184
16221
 
16185
- utils.inherits(CanceledError, AxiosError, {
16222
+ utils$1.inherits(CanceledError, AxiosError, {
16186
16223
  __CANCEL__: true
16187
16224
  });
16188
16225
 
@@ -16210,53 +16247,44 @@ function settle(resolve, reject, response) {
16210
16247
  }
16211
16248
  }
16212
16249
 
16213
- var cookies = platform.isStandardBrowserEnv ?
16250
+ var cookies = platform.hasStandardBrowserEnv ?
16214
16251
 
16215
- // Standard browser envs support document.cookie
16216
- (function standardBrowserEnv() {
16217
- return {
16218
- write: function write(name, value, expires, path, domain, secure) {
16219
- const cookie = [];
16220
- cookie.push(name + '=' + encodeURIComponent(value));
16252
+ // Standard browser envs support document.cookie
16253
+ {
16254
+ write(name, value, expires, path, domain, secure) {
16255
+ const cookie = [name + '=' + encodeURIComponent(value)];
16221
16256
 
16222
- if (utils.isNumber(expires)) {
16223
- cookie.push('expires=' + new Date(expires).toGMTString());
16224
- }
16257
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
16225
16258
 
16226
- if (utils.isString(path)) {
16227
- cookie.push('path=' + path);
16228
- }
16259
+ utils$1.isString(path) && cookie.push('path=' + path);
16229
16260
 
16230
- if (utils.isString(domain)) {
16231
- cookie.push('domain=' + domain);
16232
- }
16261
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
16233
16262
 
16234
- if (secure === true) {
16235
- cookie.push('secure');
16236
- }
16263
+ secure === true && cookie.push('secure');
16237
16264
 
16238
- document.cookie = cookie.join('; ');
16239
- },
16265
+ document.cookie = cookie.join('; ');
16266
+ },
16240
16267
 
16241
- read: function read(name) {
16242
- const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
16243
- return (match ? decodeURIComponent(match[3]) : null);
16244
- },
16268
+ read(name) {
16269
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
16270
+ return (match ? decodeURIComponent(match[3]) : null);
16271
+ },
16245
16272
 
16246
- remove: function remove(name) {
16247
- this.write(name, '', Date.now() - 86400000);
16248
- }
16249
- };
16250
- })() :
16273
+ remove(name) {
16274
+ this.write(name, '', Date.now() - 86400000);
16275
+ }
16276
+ }
16251
16277
 
16252
- // Non standard browser env (web workers, react-native) lack needed support.
16253
- (function nonStandardBrowserEnv() {
16254
- return {
16255
- write: function write() {},
16256
- read: function read() { return null; },
16257
- remove: function remove() {}
16258
- };
16259
- })();
16278
+ :
16279
+
16280
+ // Non-standard browser env (web workers, react-native) lack needed support.
16281
+ {
16282
+ write() {},
16283
+ read() {
16284
+ return null;
16285
+ },
16286
+ remove() {}
16287
+ };
16260
16288
 
16261
16289
  /**
16262
16290
  * Determines whether the specified URL is absolute
@@ -16282,7 +16310,7 @@ function isAbsoluteURL(url) {
16282
16310
  */
16283
16311
  function combineURLs(baseURL, relativeURL) {
16284
16312
  return relativeURL
16285
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
16313
+ ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
16286
16314
  : baseURL;
16287
16315
  }
16288
16316
 
@@ -16303,7 +16331,7 @@ function buildFullPath(baseURL, requestedURL) {
16303
16331
  return requestedURL;
16304
16332
  }
16305
16333
 
16306
- var isURLSameOrigin = platform.isStandardBrowserEnv ?
16334
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
16307
16335
 
16308
16336
  // Standard browser envs have full support of the APIs needed to test
16309
16337
  // whether the request URL is of the same origin as current location.
@@ -16313,7 +16341,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
16313
16341
  let originURL;
16314
16342
 
16315
16343
  /**
16316
- * Parse a URL to discover it's components
16344
+ * Parse a URL to discover its components
16317
16345
  *
16318
16346
  * @param {String} url The URL to be parsed
16319
16347
  * @returns {Object}
@@ -16353,7 +16381,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
16353
16381
  * @returns {boolean} True if URL shares the same origin, otherwise false
16354
16382
  */
16355
16383
  return function isURLSameOrigin(requestURL) {
16356
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
16384
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
16357
16385
  return (parsed.protocol === originURL.protocol &&
16358
16386
  parsed.host === originURL.host);
16359
16387
  };
@@ -16458,7 +16486,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16458
16486
  return new Promise(function dispatchXhrRequest(resolve, reject) {
16459
16487
  let requestData = config.data;
16460
16488
  const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
16461
- const responseType = config.responseType;
16489
+ let {responseType, withXSRFToken} = config;
16462
16490
  let onCanceled;
16463
16491
  function done() {
16464
16492
  if (config.cancelToken) {
@@ -16470,11 +16498,15 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16470
16498
  }
16471
16499
  }
16472
16500
 
16473
- if (utils.isFormData(requestData)) {
16474
- if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
16501
+ let contentType;
16502
+
16503
+ if (utils$1.isFormData(requestData)) {
16504
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
16475
16505
  requestHeaders.setContentType(false); // Let the browser set it
16476
- } else {
16477
- requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
16506
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
16507
+ // fix semicolon duplication issue for ReactNative FormData implementation
16508
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
16509
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
16478
16510
  }
16479
16511
  }
16480
16512
 
@@ -16590,13 +16622,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16590
16622
  // Add xsrf header
16591
16623
  // This is only done if running in a standard browser environment.
16592
16624
  // Specifically not if we're in a web worker, or react-native.
16593
- if (platform.isStandardBrowserEnv) {
16594
- // Add xsrf header
16595
- const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
16596
- && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
16625
+ if(platform.hasStandardBrowserEnv) {
16626
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
16597
16627
 
16598
- if (xsrfValue) {
16599
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
16628
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
16629
+ // Add xsrf header
16630
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
16631
+
16632
+ if (xsrfValue) {
16633
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
16634
+ }
16600
16635
  }
16601
16636
  }
16602
16637
 
@@ -16605,13 +16640,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16605
16640
 
16606
16641
  // Add headers to the request
16607
16642
  if ('setRequestHeader' in request) {
16608
- utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
16643
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
16609
16644
  request.setRequestHeader(key, val);
16610
16645
  });
16611
16646
  }
16612
16647
 
16613
16648
  // Add withCredentials to request if needed
16614
- if (!utils.isUndefined(config.withCredentials)) {
16649
+ if (!utils$1.isUndefined(config.withCredentials)) {
16615
16650
  request.withCredentials = !!config.withCredentials;
16616
16651
  }
16617
16652
 
@@ -16666,8 +16701,8 @@ const knownAdapters = {
16666
16701
  xhr: xhrAdapter
16667
16702
  };
16668
16703
 
16669
- utils.forEach(knownAdapters, (fn, value) => {
16670
- if(fn) {
16704
+ utils$1.forEach(knownAdapters, (fn, value) => {
16705
+ if (fn) {
16671
16706
  try {
16672
16707
  Object.defineProperty(fn, 'name', {value});
16673
16708
  } catch (e) {
@@ -16677,38 +16712,56 @@ utils.forEach(knownAdapters, (fn, value) => {
16677
16712
  }
16678
16713
  });
16679
16714
 
16715
+ const renderReason = (reason) => `- ${reason}`;
16716
+
16717
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
16718
+
16680
16719
  var adapters = {
16681
16720
  getAdapter: (adapters) => {
16682
- adapters = utils.isArray(adapters) ? adapters : [adapters];
16721
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
16683
16722
 
16684
16723
  const {length} = adapters;
16685
16724
  let nameOrAdapter;
16686
16725
  let adapter;
16687
16726
 
16727
+ const rejectedReasons = {};
16728
+
16688
16729
  for (let i = 0; i < length; i++) {
16689
16730
  nameOrAdapter = adapters[i];
16690
- if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
16731
+ let id;
16732
+
16733
+ adapter = nameOrAdapter;
16734
+
16735
+ if (!isResolvedHandle(nameOrAdapter)) {
16736
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
16737
+
16738
+ if (adapter === undefined) {
16739
+ throw new AxiosError(`Unknown adapter '${id}'`);
16740
+ }
16741
+ }
16742
+
16743
+ if (adapter) {
16691
16744
  break;
16692
16745
  }
16746
+
16747
+ rejectedReasons[id || '#' + i] = adapter;
16693
16748
  }
16694
16749
 
16695
16750
  if (!adapter) {
16696
- if (adapter === false) {
16697
- throw new AxiosError(
16698
- `Adapter ${nameOrAdapter} is not supported by the environment`,
16699
- 'ERR_NOT_SUPPORT'
16751
+
16752
+ const reasons = Object.entries(rejectedReasons)
16753
+ .map(([id, state]) => `adapter ${id} ` +
16754
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
16700
16755
  );
16701
- }
16702
16756
 
16703
- throw new Error(
16704
- utils.hasOwnProp(knownAdapters, nameOrAdapter) ?
16705
- `Adapter '${nameOrAdapter}' is not available in the build` :
16706
- `Unknown adapter '${nameOrAdapter}'`
16707
- );
16708
- }
16757
+ let s = length ?
16758
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
16759
+ 'as no adapter specified';
16709
16760
 
16710
- if (!utils.isFunction(adapter)) {
16711
- throw new TypeError('adapter is not a function');
16761
+ throw new AxiosError(
16762
+ `There is no suitable adapter to dispatch the request ` + s,
16763
+ 'ERR_NOT_SUPPORT'
16764
+ );
16712
16765
  }
16713
16766
 
16714
16767
  return adapter;
@@ -16806,11 +16859,11 @@ function mergeConfig(config1, config2) {
16806
16859
  const config = {};
16807
16860
 
16808
16861
  function getMergedValue(target, source, caseless) {
16809
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
16810
- return utils.merge.call({caseless}, target, source);
16811
- } else if (utils.isPlainObject(source)) {
16812
- return utils.merge({}, source);
16813
- } else if (utils.isArray(source)) {
16862
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
16863
+ return utils$1.merge.call({caseless}, target, source);
16864
+ } else if (utils$1.isPlainObject(source)) {
16865
+ return utils$1.merge({}, source);
16866
+ } else if (utils$1.isArray(source)) {
16814
16867
  return source.slice();
16815
16868
  }
16816
16869
  return source;
@@ -16818,25 +16871,25 @@ function mergeConfig(config1, config2) {
16818
16871
 
16819
16872
  // eslint-disable-next-line consistent-return
16820
16873
  function mergeDeepProperties(a, b, caseless) {
16821
- if (!utils.isUndefined(b)) {
16874
+ if (!utils$1.isUndefined(b)) {
16822
16875
  return getMergedValue(a, b, caseless);
16823
- } else if (!utils.isUndefined(a)) {
16876
+ } else if (!utils$1.isUndefined(a)) {
16824
16877
  return getMergedValue(undefined, a, caseless);
16825
16878
  }
16826
16879
  }
16827
16880
 
16828
16881
  // eslint-disable-next-line consistent-return
16829
16882
  function valueFromConfig2(a, b) {
16830
- if (!utils.isUndefined(b)) {
16883
+ if (!utils$1.isUndefined(b)) {
16831
16884
  return getMergedValue(undefined, b);
16832
16885
  }
16833
16886
  }
16834
16887
 
16835
16888
  // eslint-disable-next-line consistent-return
16836
16889
  function defaultToConfig2(a, b) {
16837
- if (!utils.isUndefined(b)) {
16890
+ if (!utils$1.isUndefined(b)) {
16838
16891
  return getMergedValue(undefined, b);
16839
- } else if (!utils.isUndefined(a)) {
16892
+ } else if (!utils$1.isUndefined(a)) {
16840
16893
  return getMergedValue(undefined, a);
16841
16894
  }
16842
16895
  }
@@ -16861,6 +16914,7 @@ function mergeConfig(config1, config2) {
16861
16914
  timeout: defaultToConfig2,
16862
16915
  timeoutMessage: defaultToConfig2,
16863
16916
  withCredentials: defaultToConfig2,
16917
+ withXSRFToken: defaultToConfig2,
16864
16918
  adapter: defaultToConfig2,
16865
16919
  responseType: defaultToConfig2,
16866
16920
  xsrfCookieName: defaultToConfig2,
@@ -16881,16 +16935,16 @@ function mergeConfig(config1, config2) {
16881
16935
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
16882
16936
  };
16883
16937
 
16884
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
16938
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
16885
16939
  const merge = mergeMap[prop] || mergeDeepProperties;
16886
16940
  const configValue = merge(config1[prop], config2[prop], prop);
16887
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
16941
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
16888
16942
  });
16889
16943
 
16890
16944
  return config;
16891
16945
  }
16892
16946
 
16893
- const VERSION = "1.4.0";
16947
+ const VERSION = "1.6.5";
16894
16948
 
16895
16949
  const validators$1 = {};
16896
16950
 
@@ -17028,7 +17082,7 @@ class Axios {
17028
17082
  }
17029
17083
 
17030
17084
  if (paramsSerializer != null) {
17031
- if (utils.isFunction(paramsSerializer)) {
17085
+ if (utils$1.isFunction(paramsSerializer)) {
17032
17086
  config.paramsSerializer = {
17033
17087
  serialize: paramsSerializer
17034
17088
  };
@@ -17043,15 +17097,13 @@ class Axios {
17043
17097
  // Set config.method
17044
17098
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
17045
17099
 
17046
- let contextHeaders;
17047
-
17048
17100
  // Flatten headers
17049
- contextHeaders = headers && utils.merge(
17101
+ let contextHeaders = headers && utils$1.merge(
17050
17102
  headers.common,
17051
17103
  headers[config.method]
17052
17104
  );
17053
17105
 
17054
- contextHeaders && utils.forEach(
17106
+ headers && utils$1.forEach(
17055
17107
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
17056
17108
  (method) => {
17057
17109
  delete headers[method];
@@ -17138,7 +17190,7 @@ class Axios {
17138
17190
  }
17139
17191
 
17140
17192
  // Provide aliases for supported request methods
17141
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
17193
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
17142
17194
  /*eslint func-names:0*/
17143
17195
  Axios.prototype[method] = function(url, config) {
17144
17196
  return this.request(mergeConfig(config || {}, {
@@ -17149,7 +17201,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
17149
17201
  };
17150
17202
  });
17151
17203
 
17152
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
17204
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
17153
17205
  /*eslint func-names:0*/
17154
17206
 
17155
17207
  function generateHTTPMethod(isForm) {
@@ -17325,7 +17377,7 @@ function spread(callback) {
17325
17377
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
17326
17378
  */
17327
17379
  function isAxiosError(payload) {
17328
- return utils.isObject(payload) && (payload.isAxiosError === true);
17380
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
17329
17381
  }
17330
17382
 
17331
17383
  const HttpStatusCode = {
@@ -17412,10 +17464,10 @@ function createInstance(defaultConfig) {
17412
17464
  const instance = bind(Axios$1.prototype.request, context);
17413
17465
 
17414
17466
  // Copy axios.prototype to instance
17415
- utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
17467
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
17416
17468
 
17417
17469
  // Copy context to instance
17418
- utils.extend(instance, context, null, {allOwnKeys: true});
17470
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
17419
17471
 
17420
17472
  // Factory for creating new instances
17421
17473
  instance.create = function create(instanceConfig) {
@@ -17459,7 +17511,9 @@ axios.mergeConfig = mergeConfig;
17459
17511
 
17460
17512
  axios.AxiosHeaders = AxiosHeaders$1;
17461
17513
 
17462
- axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
17514
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
17515
+
17516
+ axios.getAdapter = adapters.getAdapter;
17463
17517
 
17464
17518
  axios.HttpStatusCode = HttpStatusCode$1;
17465
17519
 
@@ -31263,7 +31317,7 @@ const _abi$3 = [
31263
31317
  class ERC20__factory {
31264
31318
  static abi = _abi$3;
31265
31319
  static createInterface() {
31266
- return new utils$2.Interface(_abi$3);
31320
+ return new utils$3.Interface(_abi$3);
31267
31321
  }
31268
31322
  static connect(address, signerOrProvider) {
31269
31323
  return new Contract$1(address, _abi$3, signerOrProvider);
@@ -32065,7 +32119,7 @@ class ImmutableSwapProxy__factory extends ContractFactory {
32065
32119
  static bytecode = _bytecode$2;
32066
32120
  static abi = _abi$2;
32067
32121
  static createInterface() {
32068
- return new utils$2.Interface(_abi$2);
32122
+ return new utils$3.Interface(_abi$2);
32069
32123
  }
32070
32124
  static connect(address, signerOrProvider) {
32071
32125
  return new Contract$1(address, _abi$2, signerOrProvider);
@@ -32193,7 +32247,7 @@ class Multicall__factory extends ContractFactory {
32193
32247
  static bytecode = _bytecode$1;
32194
32248
  static abi = _abi$1;
32195
32249
  static createInterface() {
32196
- return new utils$2.Interface(_abi$1);
32250
+ return new utils$3.Interface(_abi$1);
32197
32251
  }
32198
32252
  static connect(address, signerOrProvider) {
32199
32253
  return new Contract$1(address, _abi$1, signerOrProvider);
@@ -33217,7 +33271,7 @@ class UniswapV3Pool__factory extends ContractFactory {
33217
33271
  static bytecode = _bytecode;
33218
33272
  static abi = _abi;
33219
33273
  static createInterface() {
33220
- return new utils$2.Interface(_abi);
33274
+ return new utils$3.Interface(_abi);
33221
33275
  }
33222
33276
  static connect(address, signerOrProvider) {
33223
33277
  return new Contract$1(address, _abi, signerOrProvider);
@@ -33424,7 +33478,7 @@ async function getQuotesForRoutes(provider, quoterContractAddress, routes, amoun
33424
33478
  return quoteResults;
33425
33479
  }
33426
33480
  try {
33427
- const decodedQuoteResult = utils$2.defaultAbiCoder.decode(returnTypes, promiseResult.value);
33481
+ const decodedQuoteResult = utils$3.defaultAbiCoder.decode(returnTypes, promiseResult.value);
33428
33482
  if (decodedQuoteResult) {
33429
33483
  // The 0th element in each decoded data is going to be the amountOut or amountIn.
33430
33484
  const quoteAmount = decodedQuoteResult[amountIndex];
@@ -34254,7 +34308,7 @@ const CONTRACTS_FOR_CHAIN_ID = {
34254
34308
  coreFactory: '0xb18c44b211065E69844FbA9AE146DA362104AfBf',
34255
34309
  quoterV2: '0x87854A7D4b9BaC3D37f4516A1Ac7F36fB5ad539f',
34256
34310
  peripheryRouter: '0x786ec643F231960D4C1A4E336990F8E7bF8f1277',
34257
- secondaryFee: '0xCe11A21e7b6B4650C3B6363446fa1aa486A5146A',
34311
+ immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
34258
34312
  },
34259
34313
  };
34260
34314
  const SUPPORTED_SANDBOX_CHAINS = {
@@ -34363,7 +34417,7 @@ class Exchange {
34363
34417
  this.nativeTokenService = new NativeTokenService(this.nativeToken, this.wrappedNativeToken);
34364
34418
  this.secondaryFees = config.secondaryFees;
34365
34419
  this.routerContractAddress = config.chain.contracts.peripheryRouter;
34366
- this.swapProxyContractAddress = config.chain.contracts.secondaryFee;
34420
+ this.swapProxyContractAddress = config.chain.contracts.immutableSwapProxy;
34367
34421
  this.provider = new ethers.providers.StaticJsonRpcProvider({
34368
34422
  url: config.chain.rpcUrl,
34369
34423
  skipFetchSetup: true,
@@ -35406,7 +35460,7 @@ const GAS_OVERRIDES = {
35406
35460
  maxPriorityFeePerGas: BigNumber$1.from(101e9),
35407
35461
  };
35408
35462
 
35409
- const SDK_VERSION_MARKER = '0.39.1';
35463
+ const SDK_VERSION_MARKER = '0.39.2';
35410
35464
  // This SDK version is replaced by the `yarn build` command ran on the root level
35411
35465
  const globalPackageVersion = () => SDK_VERSION_MARKER;
35412
35466
 
@@ -35544,6 +35598,8 @@ class CheckoutConfiguration {
35544
35598
  const getTokenAllowList = async (config, { type = TokenFilterTypes.ALL, chainId, exclude, }) => {
35545
35599
  let tokens = [];
35546
35600
  let onRampConfig;
35601
+ let onBridgeConfig;
35602
+ const targetChainId = chainId ?? getL1ChainId(config);
35547
35603
  switch (type) {
35548
35604
  case TokenFilterTypes.SWAP:
35549
35605
  // Fetch tokens from dex-tokens config because
@@ -35554,16 +35610,19 @@ const getTokenAllowList = async (config, { type = TokenFilterTypes.ALL, chainId,
35554
35610
  break;
35555
35611
  case TokenFilterTypes.ONRAMP:
35556
35612
  onRampConfig = (await config.remote.getConfig('onramp'));
35557
- // Only using Transak as it's the only on-ramp provider at the moment
35558
- if (!onRampConfig) {
35613
+ if (!onRampConfig)
35559
35614
  tokens = [];
35560
- }
35561
35615
  tokens = onRampConfig[OnRampProvider.TRANSAK]?.tokens || [];
35562
35616
  break;
35563
35617
  case TokenFilterTypes.BRIDGE:
35618
+ onBridgeConfig = (await config.remote.getConfig('bridge'));
35619
+ if (!onBridgeConfig)
35620
+ tokens = [];
35621
+ tokens = onBridgeConfig[targetChainId]?.tokens || [];
35622
+ break;
35564
35623
  case TokenFilterTypes.ALL:
35565
35624
  default:
35566
- tokens = (await config.remote.getTokensConfig(chainId || getL1ChainId(config))).allowed;
35625
+ tokens = (await config.remote.getTokensConfig(targetChainId)).allowed;
35567
35626
  }
35568
35627
  if (!exclude || exclude?.length === 0)
35569
35628
  return { tokens };
@@ -35750,7 +35809,7 @@ const getBalance = async (config, web3Provider, walletAddress) => await withChec
35750
35809
  const balance = await web3Provider.getBalance(walletAddress);
35751
35810
  return {
35752
35811
  balance,
35753
- formattedBalance: utils$2.formatUnits(balance, networkInfo.nativeCurrency.decimals),
35812
+ formattedBalance: utils$3.formatUnits(balance, networkInfo.nativeCurrency.decimals),
35754
35813
  token: networkInfo.nativeCurrency,
35755
35814
  };
35756
35815
  }, { type: CheckoutErrorType.GET_BALANCE_ERROR });
@@ -35762,7 +35821,7 @@ async function getERC20Balance(web3Provider, walletAddress, tokenAddress) {
35762
35821
  contract.balanceOf(walletAddress),
35763
35822
  ])
35764
35823
  .then(([tokenInfo, balance]) => {
35765
- const formattedBalance = utils$2.formatUnits(balance, tokenInfo.decimals);
35824
+ const formattedBalance = utils$3.formatUnits(balance, tokenInfo.decimals);
35766
35825
  return {
35767
35826
  balance,
35768
35827
  formattedBalance,
@@ -35861,7 +35920,7 @@ const getIndexerBalance = async (config, walletAddress, chainId, filterTokens) =
35861
35920
  ...tokenData,
35862
35921
  decimals,
35863
35922
  };
35864
- const formattedBalance = utils$2.formatUnits(item.value, token.decimals);
35923
+ const formattedBalance = utils$3.formatUnits(item.value, token.decimals);
35865
35924
  balances.push({ balance, formattedBalance, token });
35866
35925
  });
35867
35926
  return { balances };
@@ -36211,7 +36270,7 @@ async function swapGasEstimator(config) {
36211
36270
  try {
36212
36271
  const exchange = await createExchangeInstance(chainId, config);
36213
36272
  // Create a fake transaction to get the gas from the quote
36214
- const { swap } = await exchange.getUnsignedSwapTxFromAmountIn(DUMMY_WALLET_ADDRESS, inAddress, outAddress, BigNumber$1.from(utils$2.parseUnits('1', DEFAULT_TOKEN_DECIMALS)));
36273
+ const { swap } = await exchange.getUnsignedSwapTxFromAmountIn(DUMMY_WALLET_ADDRESS, inAddress, outAddress, BigNumber$1.from(utils$3.parseUnits('1', DEFAULT_TOKEN_DECIMALS)));
36215
36274
  if (!swap.gasFeeEstimate) {
36216
36275
  return {
36217
36276
  gasEstimateType: GasEstimateType.SWAP,
@@ -36730,7 +36789,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
36730
36789
  type: ItemType.NATIVE,
36731
36790
  delta: {
36732
36791
  balance: delta,
36733
- formattedBalance: utils$2.formatUnits(delta, decimals),
36792
+ formattedBalance: utils$3.formatUnits(delta, decimals),
36734
36793
  },
36735
36794
  current: {
36736
36795
  ...tokenBalanceResult,
@@ -36740,7 +36799,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
36740
36799
  ...tokenBalanceResult,
36741
36800
  type: ItemType.NATIVE,
36742
36801
  balance: BigNumber$1.from(itemRequirement.amount),
36743
- formattedBalance: utils$2.formatUnits(itemRequirement.amount, decimals),
36802
+ formattedBalance: utils$3.formatUnits(itemRequirement.amount, decimals),
36744
36803
  },
36745
36804
  };
36746
36805
  }
@@ -36763,13 +36822,13 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
36763
36822
  type: ItemType.ERC20,
36764
36823
  delta: {
36765
36824
  balance: delta,
36766
- formattedBalance: utils$2.formatUnits(delta, decimals),
36825
+ formattedBalance: utils$3.formatUnits(delta, decimals),
36767
36826
  },
36768
36827
  current: tokenBalanceResult,
36769
36828
  required: {
36770
36829
  ...tokenBalanceResult,
36771
36830
  balance: BigNumber$1.from(itemRequirement.amount),
36772
- formattedBalance: utils$2.formatUnits(itemRequirement.amount, decimals),
36831
+ formattedBalance: utils$3.formatUnits(itemRequirement.amount, decimals),
36773
36832
  },
36774
36833
  };
36775
36834
  };
@@ -37141,7 +37200,7 @@ const constructFees$1 = (approvalGasFee, swapGasFee, swapFees) => {
37141
37200
  let approvalToken;
37142
37201
  if (approvalGasFee) {
37143
37202
  approvalGasFeeAmount = approvalGasFee.value;
37144
- approvalGasFeeFormatted = utils$2.formatUnits(approvalGasFee.value, approvalGasFee.token.decimals);
37203
+ approvalGasFeeFormatted = utils$3.formatUnits(approvalGasFee.value, approvalGasFee.token.decimals);
37145
37204
  approvalToken = {
37146
37205
  name: approvalGasFee.token.name ?? '',
37147
37206
  symbol: approvalGasFee.token.symbol ?? '',
@@ -37154,7 +37213,7 @@ const constructFees$1 = (approvalGasFee, swapGasFee, swapFees) => {
37154
37213
  let swapGasToken;
37155
37214
  if (swapGasFee) {
37156
37215
  swapGasFeeAmount = swapGasFee.value;
37157
- swapGasFeeFormatted = utils$2.formatUnits(swapGasFee.value, swapGasFee.token.decimals);
37216
+ swapGasFeeFormatted = utils$3.formatUnits(swapGasFee.value, swapGasFee.token.decimals);
37158
37217
  swapGasToken = {
37159
37218
  name: swapGasFee.token.name ?? '',
37160
37219
  symbol: swapGasFee.token.symbol ?? '',
@@ -37167,7 +37226,7 @@ const constructFees$1 = (approvalGasFee, swapGasFee, swapFees) => {
37167
37226
  fees.push({
37168
37227
  type: FeeType.SWAP_FEE,
37169
37228
  amount: swapFee.amount.value,
37170
- formattedAmount: utils$2.formatUnits(swapFee.amount.value, swapFee.amount.token.decimals),
37229
+ formattedAmount: utils$3.formatUnits(swapFee.amount.value, swapFee.amount.token.decimals),
37171
37230
  token: {
37172
37231
  name: swapFee.amount.token.name ?? '',
37173
37232
  symbol: swapFee.amount.token.symbol ?? '',
@@ -37205,7 +37264,7 @@ const constructSwapRoute = (chainId, fundsRequired, userBalance, fees) => {
37205
37264
  type,
37206
37265
  fundsRequired: {
37207
37266
  amount: fundsRequired,
37208
- formattedAmount: utils$2.formatUnits(fundsRequired, userBalance.token.decimals),
37267
+ formattedAmount: utils$3.formatUnits(fundsRequired, userBalance.token.decimals),
37209
37268
  },
37210
37269
  userBalance: {
37211
37270
  balance: userBalance.balance,
@@ -37421,28 +37480,23 @@ const filterTokens = (allowedTokens, balances) => {
37421
37480
  };
37422
37481
  const allowListCheckForOnRamp = async (config, availableRoutingOptions) => {
37423
37482
  if (availableRoutingOptions.onRamp) {
37424
- const onRampOptions = await config.remote.getConfig('onramp');
37425
- const onRampAllowList = {};
37426
- Object.entries(onRampOptions)
37427
- .forEach(([onRampProvider, onRampProviderConfig]) => {
37428
- // Allowed list per onRamp provider
37429
- onRampAllowList[onRampProvider] = onRampProviderConfig.tokens ?? [];
37430
- });
37431
- return onRampAllowList;
37483
+ const onRampOptions = (await getTokenAllowList(config, { type: TokenFilterTypes.ONRAMP }));
37484
+ return onRampOptions.tokens;
37432
37485
  }
37433
- return {};
37486
+ return [];
37434
37487
  };
37435
37488
  const allowListCheckForBridge = async (config, tokenBalances, availableRoutingOptions) => {
37436
37489
  if (availableRoutingOptions.bridge) {
37437
- const allowedTokens = (await config.remote.getConfig('bridge'))?.tokens ?? [];
37438
- const balances = tokenBalances.get(getL1ChainId(config));
37490
+ const chainId = getL1ChainId(config);
37491
+ const allowedTokens = (await getTokenAllowList(config, { type: TokenFilterTypes.BRIDGE, chainId })).tokens;
37492
+ const balances = tokenBalances.get(chainId);
37439
37493
  return filterTokens(allowedTokens, balances);
37440
37494
  }
37441
37495
  return [];
37442
37496
  };
37443
37497
  const allowListCheckForSwap = async (config, tokenBalances, availableRoutingOptions) => {
37444
37498
  if (availableRoutingOptions.swap) {
37445
- const allowedTokens = (await config.remote.getConfig('dex'))?.tokens ?? [];
37499
+ const allowedTokens = (await getTokenAllowList(config, { type: TokenFilterTypes.SWAP })).tokens;
37446
37500
  const balances = tokenBalances.get(getL2ChainId(config));
37447
37501
  return filterTokens(allowedTokens, balances);
37448
37502
  }
@@ -37544,7 +37598,7 @@ const constructFees = (bridgeGasFee, bridgeFee, imtblFee, approvalGasFee, token)
37544
37598
  bridgeFees.push({
37545
37599
  type: FeeType.BRIDGE_FEE,
37546
37600
  amount: bridgeFee,
37547
- formattedAmount: utils$2.formatUnits(bridgeFee, bridgeFeeDecimals),
37601
+ formattedAmount: utils$3.formatUnits(bridgeFee, bridgeFeeDecimals),
37548
37602
  token,
37549
37603
  });
37550
37604
  }
@@ -37552,7 +37606,7 @@ const constructFees = (bridgeGasFee, bridgeFee, imtblFee, approvalGasFee, token)
37552
37606
  bridgeFees.push({
37553
37607
  type: FeeType.IMMUTABLE_FEE,
37554
37608
  amount: imtblFee,
37555
- formattedAmount: utils$2.formatUnits(imtblFee, bridgeFeeDecimals),
37609
+ formattedAmount: utils$3.formatUnits(imtblFee, bridgeFeeDecimals),
37556
37610
  token,
37557
37611
  });
37558
37612
  }
@@ -37560,13 +37614,13 @@ const constructFees = (bridgeGasFee, bridgeFee, imtblFee, approvalGasFee, token)
37560
37614
  approvalGasFee: {
37561
37615
  type: FeeType.GAS,
37562
37616
  amount: approvalGasFee,
37563
- formattedAmount: utils$2.formatUnits(approvalGasFee, DEFAULT_TOKEN_DECIMALS$1),
37617
+ formattedAmount: utils$3.formatUnits(approvalGasFee, DEFAULT_TOKEN_DECIMALS$1),
37564
37618
  token,
37565
37619
  },
37566
37620
  bridgeGasFee: {
37567
37621
  type: FeeType.GAS,
37568
37622
  amount: bridgeGasFee,
37569
- formattedAmount: utils$2.formatUnits(bridgeGasFee, DEFAULT_TOKEN_DECIMALS$1),
37623
+ formattedAmount: utils$3.formatUnits(bridgeGasFee, DEFAULT_TOKEN_DECIMALS$1),
37570
37624
  token,
37571
37625
  },
37572
37626
  bridgeFees,
@@ -37771,7 +37825,7 @@ const constructBridgeRequirements = (dexQuotes, l1balances, l2balances, l1tol2ad
37771
37825
  }
37772
37826
  bridgeRequirements.push({
37773
37827
  amount: amountToBridge,
37774
- formattedAmount: utils$2.formatUnits(amountToBridge, l1balance.token.decimals),
37828
+ formattedAmount: utils$3.formatUnits(amountToBridge, l1balance.token.decimals),
37775
37829
  // L2 address is used for the bridge requirement as the bridge route uses the indexer to find L1 address
37776
37830
  l2address,
37777
37831
  });
@@ -37869,7 +37923,7 @@ const modifyTokenBalancesWithBridgedAmount = (config, tokenBalances, l2balances,
37869
37923
  const tokenInfo = swappableTokens.find((token) => token.address === l2address);
37870
37924
  balanceMap.set(l2address, {
37871
37925
  balance: newBalance,
37872
- formattedBalance: utils$2.formatUnits(newBalance, tokenInfo.decimals),
37926
+ formattedBalance: utils$3.formatUnits(newBalance, tokenInfo.decimals),
37873
37927
  token: tokenInfo,
37874
37928
  });
37875
37929
  }
@@ -38000,10 +38054,10 @@ const onRampRoute = async (config, availableRoutingOptions, balanceRequirement)
38000
38054
  return undefined;
38001
38055
  const { required, current, delta } = balanceRequirement;
38002
38056
  let hasAllowList = false;
38003
- const onRampProvidersAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
38004
- Object.values(onRampProvidersAllowList).forEach((onRampAllowList) => {
38005
- if (onRampAllowList.length > 0 && !hasAllowList) {
38006
- hasAllowList = !!onRampAllowList.find((token) => token.address === required.token?.address);
38057
+ const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
38058
+ onRampAllowList.forEach((token) => {
38059
+ if (token.address === required.token?.address) {
38060
+ hasAllowList = true;
38007
38061
  }
38008
38062
  });
38009
38063
  if (!hasAllowList)
@@ -38391,7 +38445,7 @@ const calculateFeesPercent = (orderFee, amountBn) => {
38391
38445
  };
38392
38446
  const calculateFeesToken = (orderFee, decimals) => {
38393
38447
  const feeToken = orderFee.amount;
38394
- const bnFeeAmount = utils$2.parseUnits(feeToken.token, decimals);
38448
+ const bnFeeAmount = utils$3.parseUnits(feeToken.token, decimals);
38395
38449
  return bnFeeAmount;
38396
38450
  };
38397
38451
  const calculateFees = (orderFees, weiAmount, decimals = 18) => {
@@ -38647,7 +38701,7 @@ const getERC721Requirement = (id, contractAddress, spenderAddress) => ({
38647
38701
  spenderAddress,
38648
38702
  });
38649
38703
  const getBuyToken = (buyToken, decimals = 18) => {
38650
- const bnAmount = utils$2.parseUnits(buyToken.amount, decimals);
38704
+ const bnAmount = utils$3.parseUnits(buyToken.amount, decimals);
38651
38705
  if (buyToken.type === ItemType.NATIVE) {
38652
38706
  return {
38653
38707
  type: ItemType.NATIVE,
@@ -38833,13 +38887,13 @@ async function getItemRequirementsFromRequirements(provider, requirements) {
38833
38887
  if (itemRequirementParam.type === ItemType.NATIVE) {
38834
38888
  return {
38835
38889
  ...itemRequirementParam,
38836
- amount: utils$2.parseUnits(itemRequirementParam.amount, 18),
38890
+ amount: utils$3.parseUnits(itemRequirementParam.amount, 18),
38837
38891
  };
38838
38892
  }
38839
38893
  if (itemRequirementParam.type === ItemType.ERC20) {
38840
38894
  return {
38841
38895
  ...itemRequirementParam,
38842
- amount: utils$2.parseUnits(itemRequirementParam.amount, decimals[index]),
38896
+ amount: utils$3.parseUnits(itemRequirementParam.amount, decimals[index]),
38843
38897
  };
38844
38898
  }
38845
38899
  return itemRequirementParam;