@squidcloud/client 1.0.144-beta → 1.0.144

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/cjs/index.js CHANGED
@@ -7361,6 +7361,567 @@ __exportStar(__webpack_require__(4356), exports);
7361
7361
  __exportStar(__webpack_require__(9862), exports);
7362
7362
  //# sourceMappingURL=index.js.map
7363
7363
 
7364
+ /***/ }),
7365
+
7366
+ /***/ 9372:
7367
+ /***/ (function(module, exports) {
7368
+
7369
+ var global = typeof self !== 'undefined' ? self : this;
7370
+ var __self__ = (function () {
7371
+ function F() {
7372
+ this.fetch = false;
7373
+ this.DOMException = global.DOMException
7374
+ }
7375
+ F.prototype = global;
7376
+ return new F();
7377
+ })();
7378
+ (function(self) {
7379
+
7380
+ var irrelevant = (function (exports) {
7381
+
7382
+ var support = {
7383
+ searchParams: 'URLSearchParams' in self,
7384
+ iterable: 'Symbol' in self && 'iterator' in Symbol,
7385
+ blob:
7386
+ 'FileReader' in self &&
7387
+ 'Blob' in self &&
7388
+ (function() {
7389
+ try {
7390
+ new Blob();
7391
+ return true
7392
+ } catch (e) {
7393
+ return false
7394
+ }
7395
+ })(),
7396
+ formData: 'FormData' in self,
7397
+ arrayBuffer: 'ArrayBuffer' in self
7398
+ };
7399
+
7400
+ function isDataView(obj) {
7401
+ return obj && DataView.prototype.isPrototypeOf(obj)
7402
+ }
7403
+
7404
+ if (support.arrayBuffer) {
7405
+ var viewClasses = [
7406
+ '[object Int8Array]',
7407
+ '[object Uint8Array]',
7408
+ '[object Uint8ClampedArray]',
7409
+ '[object Int16Array]',
7410
+ '[object Uint16Array]',
7411
+ '[object Int32Array]',
7412
+ '[object Uint32Array]',
7413
+ '[object Float32Array]',
7414
+ '[object Float64Array]'
7415
+ ];
7416
+
7417
+ var isArrayBufferView =
7418
+ ArrayBuffer.isView ||
7419
+ function(obj) {
7420
+ return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
7421
+ };
7422
+ }
7423
+
7424
+ function normalizeName(name) {
7425
+ if (typeof name !== 'string') {
7426
+ name = String(name);
7427
+ }
7428
+ if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
7429
+ throw new TypeError('Invalid character in header field name')
7430
+ }
7431
+ return name.toLowerCase()
7432
+ }
7433
+
7434
+ function normalizeValue(value) {
7435
+ if (typeof value !== 'string') {
7436
+ value = String(value);
7437
+ }
7438
+ return value
7439
+ }
7440
+
7441
+ // Build a destructive iterator for the value list
7442
+ function iteratorFor(items) {
7443
+ var iterator = {
7444
+ next: function() {
7445
+ var value = items.shift();
7446
+ return {done: value === undefined, value: value}
7447
+ }
7448
+ };
7449
+
7450
+ if (support.iterable) {
7451
+ iterator[Symbol.iterator] = function() {
7452
+ return iterator
7453
+ };
7454
+ }
7455
+
7456
+ return iterator
7457
+ }
7458
+
7459
+ function Headers(headers) {
7460
+ this.map = {};
7461
+
7462
+ if (headers instanceof Headers) {
7463
+ headers.forEach(function(value, name) {
7464
+ this.append(name, value);
7465
+ }, this);
7466
+ } else if (Array.isArray(headers)) {
7467
+ headers.forEach(function(header) {
7468
+ this.append(header[0], header[1]);
7469
+ }, this);
7470
+ } else if (headers) {
7471
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
7472
+ this.append(name, headers[name]);
7473
+ }, this);
7474
+ }
7475
+ }
7476
+
7477
+ Headers.prototype.append = function(name, value) {
7478
+ name = normalizeName(name);
7479
+ value = normalizeValue(value);
7480
+ var oldValue = this.map[name];
7481
+ this.map[name] = oldValue ? oldValue + ', ' + value : value;
7482
+ };
7483
+
7484
+ Headers.prototype['delete'] = function(name) {
7485
+ delete this.map[normalizeName(name)];
7486
+ };
7487
+
7488
+ Headers.prototype.get = function(name) {
7489
+ name = normalizeName(name);
7490
+ return this.has(name) ? this.map[name] : null
7491
+ };
7492
+
7493
+ Headers.prototype.has = function(name) {
7494
+ return this.map.hasOwnProperty(normalizeName(name))
7495
+ };
7496
+
7497
+ Headers.prototype.set = function(name, value) {
7498
+ this.map[normalizeName(name)] = normalizeValue(value);
7499
+ };
7500
+
7501
+ Headers.prototype.forEach = function(callback, thisArg) {
7502
+ for (var name in this.map) {
7503
+ if (this.map.hasOwnProperty(name)) {
7504
+ callback.call(thisArg, this.map[name], name, this);
7505
+ }
7506
+ }
7507
+ };
7508
+
7509
+ Headers.prototype.keys = function() {
7510
+ var items = [];
7511
+ this.forEach(function(value, name) {
7512
+ items.push(name);
7513
+ });
7514
+ return iteratorFor(items)
7515
+ };
7516
+
7517
+ Headers.prototype.values = function() {
7518
+ var items = [];
7519
+ this.forEach(function(value) {
7520
+ items.push(value);
7521
+ });
7522
+ return iteratorFor(items)
7523
+ };
7524
+
7525
+ Headers.prototype.entries = function() {
7526
+ var items = [];
7527
+ this.forEach(function(value, name) {
7528
+ items.push([name, value]);
7529
+ });
7530
+ return iteratorFor(items)
7531
+ };
7532
+
7533
+ if (support.iterable) {
7534
+ Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
7535
+ }
7536
+
7537
+ function consumed(body) {
7538
+ if (body.bodyUsed) {
7539
+ return Promise.reject(new TypeError('Already read'))
7540
+ }
7541
+ body.bodyUsed = true;
7542
+ }
7543
+
7544
+ function fileReaderReady(reader) {
7545
+ return new Promise(function(resolve, reject) {
7546
+ reader.onload = function() {
7547
+ resolve(reader.result);
7548
+ };
7549
+ reader.onerror = function() {
7550
+ reject(reader.error);
7551
+ };
7552
+ })
7553
+ }
7554
+
7555
+ function readBlobAsArrayBuffer(blob) {
7556
+ var reader = new FileReader();
7557
+ var promise = fileReaderReady(reader);
7558
+ reader.readAsArrayBuffer(blob);
7559
+ return promise
7560
+ }
7561
+
7562
+ function readBlobAsText(blob) {
7563
+ var reader = new FileReader();
7564
+ var promise = fileReaderReady(reader);
7565
+ reader.readAsText(blob);
7566
+ return promise
7567
+ }
7568
+
7569
+ function readArrayBufferAsText(buf) {
7570
+ var view = new Uint8Array(buf);
7571
+ var chars = new Array(view.length);
7572
+
7573
+ for (var i = 0; i < view.length; i++) {
7574
+ chars[i] = String.fromCharCode(view[i]);
7575
+ }
7576
+ return chars.join('')
7577
+ }
7578
+
7579
+ function bufferClone(buf) {
7580
+ if (buf.slice) {
7581
+ return buf.slice(0)
7582
+ } else {
7583
+ var view = new Uint8Array(buf.byteLength);
7584
+ view.set(new Uint8Array(buf));
7585
+ return view.buffer
7586
+ }
7587
+ }
7588
+
7589
+ function Body() {
7590
+ this.bodyUsed = false;
7591
+
7592
+ this._initBody = function(body) {
7593
+ this._bodyInit = body;
7594
+ if (!body) {
7595
+ this._bodyText = '';
7596
+ } else if (typeof body === 'string') {
7597
+ this._bodyText = body;
7598
+ } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
7599
+ this._bodyBlob = body;
7600
+ } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
7601
+ this._bodyFormData = body;
7602
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
7603
+ this._bodyText = body.toString();
7604
+ } else if (support.arrayBuffer && support.blob && isDataView(body)) {
7605
+ this._bodyArrayBuffer = bufferClone(body.buffer);
7606
+ // IE 10-11 can't handle a DataView body.
7607
+ this._bodyInit = new Blob([this._bodyArrayBuffer]);
7608
+ } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
7609
+ this._bodyArrayBuffer = bufferClone(body);
7610
+ } else {
7611
+ this._bodyText = body = Object.prototype.toString.call(body);
7612
+ }
7613
+
7614
+ if (!this.headers.get('content-type')) {
7615
+ if (typeof body === 'string') {
7616
+ this.headers.set('content-type', 'text/plain;charset=UTF-8');
7617
+ } else if (this._bodyBlob && this._bodyBlob.type) {
7618
+ this.headers.set('content-type', this._bodyBlob.type);
7619
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
7620
+ this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
7621
+ }
7622
+ }
7623
+ };
7624
+
7625
+ if (support.blob) {
7626
+ this.blob = function() {
7627
+ var rejected = consumed(this);
7628
+ if (rejected) {
7629
+ return rejected
7630
+ }
7631
+
7632
+ if (this._bodyBlob) {
7633
+ return Promise.resolve(this._bodyBlob)
7634
+ } else if (this._bodyArrayBuffer) {
7635
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]))
7636
+ } else if (this._bodyFormData) {
7637
+ throw new Error('could not read FormData body as blob')
7638
+ } else {
7639
+ return Promise.resolve(new Blob([this._bodyText]))
7640
+ }
7641
+ };
7642
+
7643
+ this.arrayBuffer = function() {
7644
+ if (this._bodyArrayBuffer) {
7645
+ return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
7646
+ } else {
7647
+ return this.blob().then(readBlobAsArrayBuffer)
7648
+ }
7649
+ };
7650
+ }
7651
+
7652
+ this.text = function() {
7653
+ var rejected = consumed(this);
7654
+ if (rejected) {
7655
+ return rejected
7656
+ }
7657
+
7658
+ if (this._bodyBlob) {
7659
+ return readBlobAsText(this._bodyBlob)
7660
+ } else if (this._bodyArrayBuffer) {
7661
+ return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
7662
+ } else if (this._bodyFormData) {
7663
+ throw new Error('could not read FormData body as text')
7664
+ } else {
7665
+ return Promise.resolve(this._bodyText)
7666
+ }
7667
+ };
7668
+
7669
+ if (support.formData) {
7670
+ this.formData = function() {
7671
+ return this.text().then(decode)
7672
+ };
7673
+ }
7674
+
7675
+ this.json = function() {
7676
+ return this.text().then(JSON.parse)
7677
+ };
7678
+
7679
+ return this
7680
+ }
7681
+
7682
+ // HTTP methods whose capitalization should be normalized
7683
+ var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
7684
+
7685
+ function normalizeMethod(method) {
7686
+ var upcased = method.toUpperCase();
7687
+ return methods.indexOf(upcased) > -1 ? upcased : method
7688
+ }
7689
+
7690
+ function Request(input, options) {
7691
+ options = options || {};
7692
+ var body = options.body;
7693
+
7694
+ if (input instanceof Request) {
7695
+ if (input.bodyUsed) {
7696
+ throw new TypeError('Already read')
7697
+ }
7698
+ this.url = input.url;
7699
+ this.credentials = input.credentials;
7700
+ if (!options.headers) {
7701
+ this.headers = new Headers(input.headers);
7702
+ }
7703
+ this.method = input.method;
7704
+ this.mode = input.mode;
7705
+ this.signal = input.signal;
7706
+ if (!body && input._bodyInit != null) {
7707
+ body = input._bodyInit;
7708
+ input.bodyUsed = true;
7709
+ }
7710
+ } else {
7711
+ this.url = String(input);
7712
+ }
7713
+
7714
+ this.credentials = options.credentials || this.credentials || 'same-origin';
7715
+ if (options.headers || !this.headers) {
7716
+ this.headers = new Headers(options.headers);
7717
+ }
7718
+ this.method = normalizeMethod(options.method || this.method || 'GET');
7719
+ this.mode = options.mode || this.mode || null;
7720
+ this.signal = options.signal || this.signal;
7721
+ this.referrer = null;
7722
+
7723
+ if ((this.method === 'GET' || this.method === 'HEAD') && body) {
7724
+ throw new TypeError('Body not allowed for GET or HEAD requests')
7725
+ }
7726
+ this._initBody(body);
7727
+ }
7728
+
7729
+ Request.prototype.clone = function() {
7730
+ return new Request(this, {body: this._bodyInit})
7731
+ };
7732
+
7733
+ function decode(body) {
7734
+ var form = new FormData();
7735
+ body
7736
+ .trim()
7737
+ .split('&')
7738
+ .forEach(function(bytes) {
7739
+ if (bytes) {
7740
+ var split = bytes.split('=');
7741
+ var name = split.shift().replace(/\+/g, ' ');
7742
+ var value = split.join('=').replace(/\+/g, ' ');
7743
+ form.append(decodeURIComponent(name), decodeURIComponent(value));
7744
+ }
7745
+ });
7746
+ return form
7747
+ }
7748
+
7749
+ function parseHeaders(rawHeaders) {
7750
+ var headers = new Headers();
7751
+ // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
7752
+ // https://tools.ietf.org/html/rfc7230#section-3.2
7753
+ var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
7754
+ preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
7755
+ var parts = line.split(':');
7756
+ var key = parts.shift().trim();
7757
+ if (key) {
7758
+ var value = parts.join(':').trim();
7759
+ headers.append(key, value);
7760
+ }
7761
+ });
7762
+ return headers
7763
+ }
7764
+
7765
+ Body.call(Request.prototype);
7766
+
7767
+ function Response(bodyInit, options) {
7768
+ if (!options) {
7769
+ options = {};
7770
+ }
7771
+
7772
+ this.type = 'default';
7773
+ this.status = options.status === undefined ? 200 : options.status;
7774
+ this.ok = this.status >= 200 && this.status < 300;
7775
+ this.statusText = 'statusText' in options ? options.statusText : 'OK';
7776
+ this.headers = new Headers(options.headers);
7777
+ this.url = options.url || '';
7778
+ this._initBody(bodyInit);
7779
+ }
7780
+
7781
+ Body.call(Response.prototype);
7782
+
7783
+ Response.prototype.clone = function() {
7784
+ return new Response(this._bodyInit, {
7785
+ status: this.status,
7786
+ statusText: this.statusText,
7787
+ headers: new Headers(this.headers),
7788
+ url: this.url
7789
+ })
7790
+ };
7791
+
7792
+ Response.error = function() {
7793
+ var response = new Response(null, {status: 0, statusText: ''});
7794
+ response.type = 'error';
7795
+ return response
7796
+ };
7797
+
7798
+ var redirectStatuses = [301, 302, 303, 307, 308];
7799
+
7800
+ Response.redirect = function(url, status) {
7801
+ if (redirectStatuses.indexOf(status) === -1) {
7802
+ throw new RangeError('Invalid status code')
7803
+ }
7804
+
7805
+ return new Response(null, {status: status, headers: {location: url}})
7806
+ };
7807
+
7808
+ exports.DOMException = self.DOMException;
7809
+ try {
7810
+ new exports.DOMException();
7811
+ } catch (err) {
7812
+ exports.DOMException = function(message, name) {
7813
+ this.message = message;
7814
+ this.name = name;
7815
+ var error = Error(message);
7816
+ this.stack = error.stack;
7817
+ };
7818
+ exports.DOMException.prototype = Object.create(Error.prototype);
7819
+ exports.DOMException.prototype.constructor = exports.DOMException;
7820
+ }
7821
+
7822
+ function fetch(input, init) {
7823
+ return new Promise(function(resolve, reject) {
7824
+ var request = new Request(input, init);
7825
+
7826
+ if (request.signal && request.signal.aborted) {
7827
+ return reject(new exports.DOMException('Aborted', 'AbortError'))
7828
+ }
7829
+
7830
+ var xhr = new XMLHttpRequest();
7831
+
7832
+ function abortXhr() {
7833
+ xhr.abort();
7834
+ }
7835
+
7836
+ xhr.onload = function() {
7837
+ var options = {
7838
+ status: xhr.status,
7839
+ statusText: xhr.statusText,
7840
+ headers: parseHeaders(xhr.getAllResponseHeaders() || '')
7841
+ };
7842
+ options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
7843
+ var body = 'response' in xhr ? xhr.response : xhr.responseText;
7844
+ resolve(new Response(body, options));
7845
+ };
7846
+
7847
+ xhr.onerror = function() {
7848
+ reject(new TypeError('Network request failed'));
7849
+ };
7850
+
7851
+ xhr.ontimeout = function() {
7852
+ reject(new TypeError('Network request failed'));
7853
+ };
7854
+
7855
+ xhr.onabort = function() {
7856
+ reject(new exports.DOMException('Aborted', 'AbortError'));
7857
+ };
7858
+
7859
+ xhr.open(request.method, request.url, true);
7860
+
7861
+ if (request.credentials === 'include') {
7862
+ xhr.withCredentials = true;
7863
+ } else if (request.credentials === 'omit') {
7864
+ xhr.withCredentials = false;
7865
+ }
7866
+
7867
+ if ('responseType' in xhr && support.blob) {
7868
+ xhr.responseType = 'blob';
7869
+ }
7870
+
7871
+ request.headers.forEach(function(value, name) {
7872
+ xhr.setRequestHeader(name, value);
7873
+ });
7874
+
7875
+ if (request.signal) {
7876
+ request.signal.addEventListener('abort', abortXhr);
7877
+
7878
+ xhr.onreadystatechange = function() {
7879
+ // DONE (success or failure)
7880
+ if (xhr.readyState === 4) {
7881
+ request.signal.removeEventListener('abort', abortXhr);
7882
+ }
7883
+ };
7884
+ }
7885
+
7886
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
7887
+ })
7888
+ }
7889
+
7890
+ fetch.polyfill = true;
7891
+
7892
+ if (!self.fetch) {
7893
+ self.fetch = fetch;
7894
+ self.Headers = Headers;
7895
+ self.Request = Request;
7896
+ self.Response = Response;
7897
+ }
7898
+
7899
+ exports.Headers = Headers;
7900
+ exports.Request = Request;
7901
+ exports.Response = Response;
7902
+ exports.fetch = fetch;
7903
+
7904
+ Object.defineProperty(exports, '__esModule', { value: true });
7905
+
7906
+ return exports;
7907
+
7908
+ })({});
7909
+ })(__self__);
7910
+ __self__.fetch.ponyfill = true;
7911
+ // Remove "polyfill" property added by whatwg-fetch
7912
+ delete __self__.fetch.polyfill;
7913
+ // Choose between native implementation (global) or custom implementation (__self__)
7914
+ // var ctx = global.fetch ? global : __self__;
7915
+ var ctx = __self__; // this line disable service worker support temporarily
7916
+ exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
7917
+ exports["default"] = ctx.fetch // For TypeScript consumers without esModuleInterop.
7918
+ exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
7919
+ exports.Headers = ctx.Headers
7920
+ exports.Request = ctx.Request
7921
+ exports.Response = ctx.Response
7922
+ module.exports = exports
7923
+
7924
+
7364
7925
  /***/ }),
7365
7926
 
7366
7927
  /***/ 2091:
@@ -26732,6 +27293,15 @@ __webpack_require__.d(__webpack_exports__, {
26732
27293
  deserializeQuery: () => (/* reexport */ deserializeQuery)
26733
27294
  });
26734
27295
 
27296
+ // NAMESPACE OBJECT: ../node_modules/axios/lib/platform/common/utils.js
27297
+ var common_utils_namespaceObject = {};
27298
+ __webpack_require__.r(common_utils_namespaceObject);
27299
+ __webpack_require__.d(common_utils_namespaceObject, {
27300
+ hasBrowserEnv: () => (hasBrowserEnv),
27301
+ hasStandardBrowserEnv: () => (hasStandardBrowserEnv),
27302
+ hasStandardBrowserWebWorkerEnv: () => (hasStandardBrowserWebWorkerEnv)
27303
+ });
27304
+
26735
27305
  ;// CONCATENATED MODULE: ../common/src/ai-chatbot.schemas.ts
26736
27306
  /** @internal */
26737
27307
  const AiChatbotChatRequestSchema = {
@@ -27073,60 +27643,6 @@ const OpenApiDiscoveryOptionsSchema = {
27073
27643
  openApiSpecUrl: { type: 'string', nullable: true },
27074
27644
  },
27075
27645
  };
27076
- /** Generated using openai */
27077
- const ApiEndpointsSchema = {
27078
- type: 'object',
27079
- patternProperties: {
27080
- '^\\S+$': {
27081
- type: 'object',
27082
- required: ['relativePath', 'method'],
27083
- properties: {
27084
- relativePath: {
27085
- type: 'string',
27086
- },
27087
- method: {
27088
- type: 'string',
27089
- enum: ['post', 'get', 'delete', 'patch', 'put'],
27090
- },
27091
- requestSchema: {
27092
- type: 'object',
27093
- patternProperties: {
27094
- '^\\S+$': {
27095
- type: 'object',
27096
- properties: {
27097
- location: {
27098
- type: 'string',
27099
- enum: ['query', 'body', 'header', 'path'],
27100
- },
27101
- fieldNameInRequest: {
27102
- type: 'string',
27103
- },
27104
- },
27105
- },
27106
- },
27107
- },
27108
- responseSchema: {
27109
- type: 'object',
27110
- patternProperties: {
27111
- '^\\S+$': {
27112
- type: 'object',
27113
- required: ['location'],
27114
- properties: {
27115
- location: {
27116
- type: 'string',
27117
- enum: ['body', 'header'],
27118
- },
27119
- path: {
27120
- type: 'string',
27121
- },
27122
- },
27123
- },
27124
- },
27125
- },
27126
- },
27127
- },
27128
- },
27129
- };
27130
27646
  const SnowflakeConnectionOptionsSchema = {
27131
27647
  type: 'object',
27132
27648
  required: [],
@@ -28138,80 +28654,6 @@ function isSimpleCondition(condition) {
28138
28654
  function encodeCondition(condition) {
28139
28655
  return serialization_normalizeJsonAsString(condition);
28140
28656
  }
28141
- const sampleQueryMapping = {
28142
- unconditional: ['cid_123'],
28143
- conditional: {
28144
- [encodeCondition({
28145
- fields: [
28146
- {
28147
- fieldName: 'name',
28148
- operator: '>',
28149
- value: 'Yossi',
28150
- },
28151
- {
28152
- fieldName: 'age',
28153
- operator: '<',
28154
- value: 10,
28155
- },
28156
- ],
28157
- })]: ['cid_sort_order'],
28158
- [encodeCondition({
28159
- fieldName: 'age',
28160
- operator: '==',
28161
- value: 10,
28162
- })]: ['cid_321'],
28163
- [encodeCondition({
28164
- fieldName: 'age',
28165
- operator: '==',
28166
- value: 11,
28167
- })]: ['cid_321'],
28168
- [encodeCondition({
28169
- fieldName: 'age',
28170
- operator: '==',
28171
- value: 12,
28172
- })]: ['cid_321'],
28173
- [encodeCondition({
28174
- fieldName: 'age',
28175
- operator: '>',
28176
- value: 20,
28177
- })]: ['cid_456', 'cid_789'],
28178
- [encodeCondition({
28179
- fieldName: 'age',
28180
- operator: '<',
28181
- value: 20,
28182
- })]: ['cid_789'],
28183
- [encodeCondition({
28184
- fieldName: 'name',
28185
- operator: '!=',
28186
- value: 'Yossi',
28187
- })]: ['cid_not_in'],
28188
- [encodeCondition({
28189
- fieldName: 'name',
28190
- operator: '!=',
28191
- value: 'Nir',
28192
- })]: ['cid_not_in'],
28193
- },
28194
- queriesMetadata: {
28195
- cid_123: {
28196
- condCount: 0,
28197
- },
28198
- cid_321: {
28199
- condCount: 1,
28200
- },
28201
- cid_456: {
28202
- condCount: 1,
28203
- },
28204
- cid_789: {
28205
- condCount: 2,
28206
- },
28207
- cid_sort_order: {
28208
- condCount: 1,
28209
- },
28210
- cid_not_in: {
28211
- condCount: 2,
28212
- },
28213
- },
28214
- };
28215
28657
  /** @internal */
28216
28658
  class QueryMappingManager {
28217
28659
  }
@@ -28904,7 +29346,7 @@ class Pagination {
28904
29346
  // It is possible that we get here and unsubscribe() was called. In that case we might not get any new state,
28905
29347
  // so to avoid stalling we return an empty page in that situation. (We can't return the last page we saw
28906
29348
  // because that has already been deleted, and also because it's possible that we've never seen any data.)
28907
- this.isDestroyed.pipe((0,external_rxjs_namespaceObject.filter)(Boolean), (0,external_rxjs_namespaceObject.map)(_ => ({
29349
+ this.isDestroyed.pipe((0,external_rxjs_namespaceObject.filter)(Boolean), (0,external_rxjs_namespaceObject.map)(() => ({
28908
29350
  data: [],
28909
29351
  extractedData: [],
28910
29352
  numBefore: 0,
@@ -28929,7 +29371,7 @@ class Pagination {
28929
29371
  this.snapshotSubject.complete();
28930
29372
  }
28931
29373
  prevInternal(internalState) {
28932
- const { numBefore, numAfter, data, extractedData } = internalState;
29374
+ const { numBefore, numAfter, extractedData } = internalState;
28933
29375
  this.firstElement = null;
28934
29376
  this.lastElement = extractedData[numBefore - 1];
28935
29377
  this.internalStateObserver.next(null);
@@ -29186,7 +29628,7 @@ function hasDocumentDiff(beforeDoc, afterDoc) {
29186
29628
  const docIdObj = parseSquidDocId(docIdDiff.rhs + '');
29187
29629
  ignoredKeys.push(...Object.keys(docIdObj));
29188
29630
  }
29189
- const diff = diffs === null || diffs === void 0 ? void 0 : diffs.find((diff, index) => {
29631
+ const diff = diffs === null || diffs === void 0 ? void 0 : diffs.find((diff) => {
29190
29632
  var _a;
29191
29633
  // Ignore changes to the docId, ts and primaryKeys.
29192
29634
  if (ignoredKeys.includes((_a = diff.path) === null || _a === void 0 ? void 0 : _a[0]))
@@ -29689,18 +30131,6 @@ function validateFieldName(fieldName) {
29689
30131
  fieldName);
29690
30132
  }
29691
30133
  }
29692
- // TODO: remove if not used
29693
- function validateQueryCondition(condition) {
29694
- if (!condition) {
29695
- throw new Error('Condition cannot be empty');
29696
- }
29697
- if (!condition.operator ||
29698
- !['==', '!=', '>', '>=', '<', '<=', 'like', 'not like', 'like_cs', 'not like_cs'].includes(condition.operator)) {
29699
- throw new Error('Unsupported operator: ' + condition.operator);
29700
- }
29701
- validateFieldName(condition.fieldName);
29702
- // TODO - figure out how to validate the value
29703
- }
29704
30134
  function validateFieldSort(fieldSort) {
29705
30135
  if (!(fieldSort instanceof Object)) {
29706
30136
  throw new Error('Field sort has to be an object');
@@ -29929,13 +30359,13 @@ schema_types_ajv.addKeyword({
29929
30359
  });
29930
30360
  schema_types_ajv.addKeyword({
29931
30361
  keyword: 'applyDefaultValueOn',
29932
- validate: (applyDefaultValueOn, value) => {
30362
+ validate: (applyDefaultValueOn) => {
29933
30363
  return applyDefaultValueOn ? ['always', 'empty', 'updateOrEmpty'].includes(applyDefaultValueOn) : true;
29934
30364
  },
29935
30365
  });
29936
30366
  schema_types_ajv.addKeyword({
29937
30367
  keyword: 'dataType',
29938
- validate: (dataType, value) => {
30368
+ validate: () => {
29939
30369
  return true;
29940
30370
  },
29941
30371
  });
@@ -30033,7 +30463,7 @@ function findMatchingPropertiesForKey(schema, key) {
30033
30463
  .filter(([pattern]) => {
30034
30464
  return new RegExp(pattern).test(key);
30035
30465
  })
30036
- .map(([_, matchedProperty]) => matchedProperty));
30466
+ .map(([, matchedProperty]) => matchedProperty));
30037
30467
  }
30038
30468
  return matchingProperties;
30039
30469
  }
@@ -30135,6 +30565,18 @@ const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;
30135
30565
  const SECONDS_PER_WEEK = 7 * SECONDS_PER_DAY;
30136
30566
  /** @internal */
30137
30567
  const SECONDS_PER_MONTH = 30 * SECONDS_PER_DAY;
30568
+ /** @internal */
30569
+ const MILLIS_PER_SECOND = 1000;
30570
+ /** @internal */
30571
+ const MILLIS_PER_MINUTE = SECONDS_PER_MINUTE * MILLIS_PER_SECOND;
30572
+ /** @internal */
30573
+ const MILLIS_PER_HOUR = SECONDS_PER_HOUR * MILLIS_PER_SECOND;
30574
+ /** @internal */
30575
+ const MILLIS_PER_DAY = SECONDS_PER_DAY * MILLIS_PER_SECOND;
30576
+ /** @internal */
30577
+ const MILLIS_PER_WEEK = SECONDS_PER_WEEK * MILLIS_PER_SECOND;
30578
+ /** @internal */
30579
+ const MILLIS_PER_MONTH = SECONDS_PER_MONTH * MILLIS_PER_SECOND;
30138
30580
 
30139
30581
  ;// CONCATENATED MODULE: ../common/src/utils/array.ts
30140
30582
 
@@ -30287,7 +30729,7 @@ class LockManager {
30287
30729
  }
30288
30730
  const relevantLocks = Object.entries(this.locks)
30289
30731
  .filter(([mutex]) => mutexes.includes(mutex))
30290
- .map(([ignored, isLockedSubject]) => isLockedSubject);
30732
+ .map(([, isLockedSubject]) => isLockedSubject);
30291
30733
  await (0,external_rxjs_namespaceObject.lastValueFrom)((0,external_rxjs_namespaceObject.combineLatest)(relevantLocks).pipe((0,external_rxjs_namespaceObject.filter)((isLockedArray) => !isLockedArray.includes(true)), (0,external_rxjs_namespaceObject.take)(1)));
30292
30734
  await this.lock(...mutexes);
30293
30735
  }
@@ -30399,7 +30841,7 @@ function createWebSocketWrapper(url, opts = {}) {
30399
30841
  };
30400
30842
  ws.onclose = function (e) {
30401
30843
  $.connected = false;
30402
- if (e.code !== 4999) {
30844
+ if (e.code !== 4999 && e.code !== 4001) {
30403
30845
  DebugLogger.debug('WebSocket closed. Reconnecting. Close code: ', e.code);
30404
30846
  (opts.onclose || noop)(e);
30405
30847
  $.reconnect(e);
@@ -32999,12 +33441,13 @@ class AiChatbotClientFactory {
32999
33441
  this.socketManager = socketManager;
33000
33442
  this.chatbotsMap = new Map();
33001
33443
  }
33002
- getChatbot(integrationId) {
33003
- let client = this.chatbotsMap.get(integrationId);
33444
+ /** @internal */
33445
+ getChatbot(aiIntegrationId) {
33446
+ let client = this.chatbotsMap.get(aiIntegrationId);
33004
33447
  if (client)
33005
33448
  return client;
33006
- client = new AiChatbotClient(this.rpcManager, this.socketManager, integrationId);
33007
- this.chatbotsMap.set(integrationId, client);
33449
+ client = new AiChatbotClient(this.rpcManager, this.socketManager, aiIntegrationId);
33450
+ this.chatbotsMap.set(aiIntegrationId, client);
33008
33451
  return client;
33009
33452
  }
33010
33453
  }
@@ -33027,11 +33470,12 @@ class ApiManager {
33027
33470
  serverUrlOverride: this.apiServerUrlOverrideMapping[integrationId],
33028
33471
  };
33029
33472
  return (0,external_rxjs_namespaceObject.race)((0,external_rxjs_namespaceObject.from)(this.rpcManager.post('api/call', callApiRequest)).pipe(map_map(response => {
33473
+ const parsedPayload = response.payload ? deserializeObj(response.payload) : undefined;
33030
33474
  if (response.success) {
33031
- return deserializeObj(response.payload);
33475
+ return parsedPayload;
33032
33476
  }
33033
33477
  else {
33034
- throw new Error(`Got error while calling API (HTTP Status ${response.httpStatus})`);
33478
+ throw new Error(`Got error while calling API (HTTP Status ${response.httpStatus}). Message: ${parsedPayload === null || parsedPayload === void 0 ? void 0 : parsedPayload['message']}`);
33035
33479
  }
33036
33480
  })), this.clientIdService.observeClientTooOld().pipe(map_map(() => {
33037
33481
  throw new Error('CLIENT_NOT_CONNECTED');
@@ -33039,52 +33483,12 @@ class ApiManager {
33039
33483
  }
33040
33484
  }
33041
33485
 
33042
- ;// CONCATENATED MODULE: ../node_modules/rxjs/dist/esm5/internal/util/isPromise.js
33043
-
33044
- function isPromise(value) {
33045
- return isFunction(value === null || value === void 0 ? void 0 : value.then);
33046
- }
33047
- //# sourceMappingURL=isPromise.js.map
33048
33486
  ;// CONCATENATED MODULE: ./src/auth.manager.ts
33049
-
33050
-
33051
-
33052
33487
  class AuthManager {
33053
33488
  constructor(apiKey, authProvider) {
33054
33489
  this.apiKey = apiKey;
33055
33490
  this.authProvider = authProvider;
33056
33491
  }
33057
- /**
33058
- * Sets a new ID token or an ID token provider.
33059
- * @deprecated: Pass the provider via constructor options parameters or `setAuthTokenProvider()`.
33060
- */
33061
- setAuthIdToken(tokenArg, integrationId) {
33062
- // Using this warning in Datadog, we can track how many active clients use the deprecated API.
33063
- console.warn('Using a deprecated setAuthIdToken method.');
33064
- // Convert the input into AuthTokenProvider.
33065
- if (typeof tokenArg === 'string' || tokenArg === undefined) {
33066
- this.setAuthProviderForDeprecatedCode(async () => tokenArg, integrationId);
33067
- return;
33068
- }
33069
- if (typeof tokenArg === 'function') {
33070
- this.setAuthProviderForDeprecatedCode(tokenArg, integrationId);
33071
- return;
33072
- }
33073
- (0,dist.assertTruthy)(typeof tokenArg === 'object');
33074
- if ((0,external_rxjs_namespaceObject.isObservable)(tokenArg)) {
33075
- this.setAuthProviderForDeprecatedCode(() => (0,external_rxjs_namespaceObject.firstValueFrom)(tokenArg), integrationId);
33076
- return;
33077
- }
33078
- if (isPromise(tokenArg)) {
33079
- this.setAuthProviderForDeprecatedCode(() => tokenArg, integrationId);
33080
- return;
33081
- }
33082
- // tokenArg is AuthTokenProvider.
33083
- this.setAuthProviderForDeprecatedCode(tokenArg.getToken, tokenArg.integrationId || integrationId);
33084
- }
33085
- setAuthProviderForDeprecatedCode(getToken, integrationId) {
33086
- this.authProvider = { getToken, integrationId };
33087
- }
33088
33492
  /**
33089
33493
  * Sets a new auth-token provider to Squid.
33090
33494
  * All future squid backend requests will use this token provider.
@@ -33184,7 +33588,7 @@ class ClientIdService {
33184
33588
  observeClientReadyToBeRegenerated() {
33185
33589
  return this.clientTooOldSubject.pipe(
33186
33590
  // skip the initial connection
33187
- (0,external_rxjs_namespaceObject.skip)(1), (0,external_rxjs_namespaceObject.filter)(v => !v), (0,external_rxjs_namespaceObject.map)(v => undefined));
33591
+ (0,external_rxjs_namespaceObject.skip)(1), (0,external_rxjs_namespaceObject.filter)(v => !v), (0,external_rxjs_namespaceObject.map)(() => undefined));
33188
33592
  }
33189
33593
  getClientId() {
33190
33594
  return this.clientIdSubject.value;
@@ -33845,7 +34249,7 @@ class DataManager {
33845
34249
  }
33846
34250
  groupOutgoingMutationsByIntegrationId() {
33847
34251
  const outgoingMutationsByIntegrationId = {};
33848
- for (const [_, outgoingMutations] of [...this.pendingOutgoingMutations.entries()]) {
34252
+ for (const [, outgoingMutations] of [...this.pendingOutgoingMutations.entries()]) {
33849
34253
  const latestOutgoingMutation = outgoingMutations[outgoingMutations.length - 1];
33850
34254
  if (latestOutgoingMutation && !latestOutgoingMutation.sentToServer) {
33851
34255
  const integrationId = latestOutgoingMutation.mutation.squidDocIdObj.integrationId;
@@ -34132,7 +34536,7 @@ class DocumentReferenceFactory {
34132
34536
  * @internal
34133
34537
  */
34134
34538
  migrateDocIds(idResolutionMap) {
34135
- for (const [_, reference] of this.documents) {
34539
+ for (const [, reference] of this.documents) {
34136
34540
  reference.migrateDocIds(idResolutionMap);
34137
34541
  }
34138
34542
  Object.entries(idResolutionMap).forEach(([squidDocId, newSquidDocId]) => {
@@ -47446,9 +47850,9 @@ var extras = {
47446
47850
  gql["default"] = gql;
47447
47851
  /* harmony default export */ const lib = ((/* unused pure expression or super */ null && (gql)));
47448
47852
  //# sourceMappingURL=index.js.map
47449
- ;// CONCATENATED MODULE: external "cross-fetch"
47450
- const external_cross_fetch_namespaceObject = require("cross-fetch");
47451
- var external_cross_fetch_default = /*#__PURE__*/__webpack_require__.n(external_cross_fetch_namespaceObject);
47853
+ // EXTERNAL MODULE: ../node_modules/cross-fetch/dist/browser-ponyfill.js
47854
+ var browser_ponyfill = __webpack_require__(9372);
47855
+ var browser_ponyfill_default = /*#__PURE__*/__webpack_require__.n(browser_ponyfill);
47452
47856
  ;// CONCATENATED MODULE: ./src/graphql-client.ts
47453
47857
 
47454
47858
 
@@ -47464,7 +47868,7 @@ class GraphQLClient {
47464
47868
  link: new HttpLink({
47465
47869
  uri: url,
47466
47870
  headers: this.rpcManager.getStaticHeaders(),
47467
- fetch: (external_cross_fetch_default()),
47871
+ fetch: (browser_ponyfill_default()),
47468
47872
  }),
47469
47873
  cache: new InMemoryCache(),
47470
47874
  });
@@ -48377,7 +48781,7 @@ class QuerySubscriptionManager {
48377
48781
  return this.allOngoingQueriesGotInitialResult(rootOngoingQuery);
48378
48782
  }), (0,external_rxjs_namespaceObject.startWith)(undefined), (0,external_rxjs_namespaceObject.pairwise)(), filter(([before, after]) => {
48379
48783
  return !lodash.isEqual(before, after);
48380
- }), map_map(([_ignored, after]) => after),
48784
+ }), map_map(([, after]) => after),
48381
48785
  // This handles 'subscribe = false'
48382
48786
  subscribe ? (0,external_rxjs_namespaceObject.tap)() : (0,external_rxjs_namespaceObject.take)(1), (0,external_rxjs_namespaceObject.finalize)(() => {
48383
48787
  var _a;
@@ -49021,6 +49425,3509 @@ class RateLimiter {
49021
49425
  }
49022
49426
  }
49023
49427
 
49428
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/bind.js
49429
+
49430
+
49431
+ function bind_bind(fn, thisArg) {
49432
+ return function wrap() {
49433
+ return fn.apply(thisArg, arguments);
49434
+ };
49435
+ }
49436
+
49437
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/utils.js
49438
+
49439
+
49440
+
49441
+
49442
+ // utils is a library of generic helper functions non-specific to axios
49443
+
49444
+ const {toString: utils_toString} = Object.prototype;
49445
+ const {getPrototypeOf} = Object;
49446
+
49447
+ const kindOf = (cache => thing => {
49448
+ const str = utils_toString.call(thing);
49449
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
49450
+ })(Object.create(null));
49451
+
49452
+ const kindOfTest = (type) => {
49453
+ type = type.toLowerCase();
49454
+ return (thing) => kindOf(thing) === type
49455
+ }
49456
+
49457
+ const typeOfTest = type => thing => typeof thing === type;
49458
+
49459
+ /**
49460
+ * Determine if a value is an Array
49461
+ *
49462
+ * @param {Object} val The value to test
49463
+ *
49464
+ * @returns {boolean} True if value is an Array, otherwise false
49465
+ */
49466
+ const {isArray: utils_isArray} = Array;
49467
+
49468
+ /**
49469
+ * Determine if a value is undefined
49470
+ *
49471
+ * @param {*} val The value to test
49472
+ *
49473
+ * @returns {boolean} True if the value is undefined, otherwise false
49474
+ */
49475
+ const isUndefined = typeOfTest('undefined');
49476
+
49477
+ /**
49478
+ * Determine if a value is a Buffer
49479
+ *
49480
+ * @param {*} val The value to test
49481
+ *
49482
+ * @returns {boolean} True if value is a Buffer, otherwise false
49483
+ */
49484
+ function isBuffer(val) {
49485
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
49486
+ && utils_isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
49487
+ }
49488
+
49489
+ /**
49490
+ * Determine if a value is an ArrayBuffer
49491
+ *
49492
+ * @param {*} val The value to test
49493
+ *
49494
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
49495
+ */
49496
+ const isArrayBuffer = kindOfTest('ArrayBuffer');
49497
+
49498
+
49499
+ /**
49500
+ * Determine if a value is a view on an ArrayBuffer
49501
+ *
49502
+ * @param {*} val The value to test
49503
+ *
49504
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
49505
+ */
49506
+ function isArrayBufferView(val) {
49507
+ let result;
49508
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
49509
+ result = ArrayBuffer.isView(val);
49510
+ } else {
49511
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
49512
+ }
49513
+ return result;
49514
+ }
49515
+
49516
+ /**
49517
+ * Determine if a value is a String
49518
+ *
49519
+ * @param {*} val The value to test
49520
+ *
49521
+ * @returns {boolean} True if value is a String, otherwise false
49522
+ */
49523
+ const isString = typeOfTest('string');
49524
+
49525
+ /**
49526
+ * Determine if a value is a Function
49527
+ *
49528
+ * @param {*} val The value to test
49529
+ * @returns {boolean} True if value is a Function, otherwise false
49530
+ */
49531
+ const utils_isFunction = typeOfTest('function');
49532
+
49533
+ /**
49534
+ * Determine if a value is a Number
49535
+ *
49536
+ * @param {*} val The value to test
49537
+ *
49538
+ * @returns {boolean} True if value is a Number, otherwise false
49539
+ */
49540
+ const isNumber = typeOfTest('number');
49541
+
49542
+ /**
49543
+ * Determine if a value is an Object
49544
+ *
49545
+ * @param {*} thing The value to test
49546
+ *
49547
+ * @returns {boolean} True if value is an Object, otherwise false
49548
+ */
49549
+ const isObject = (thing) => thing !== null && typeof thing === 'object';
49550
+
49551
+ /**
49552
+ * Determine if a value is a Boolean
49553
+ *
49554
+ * @param {*} thing The value to test
49555
+ * @returns {boolean} True if value is a Boolean, otherwise false
49556
+ */
49557
+ const isBoolean = thing => thing === true || thing === false;
49558
+
49559
+ /**
49560
+ * Determine if a value is a plain Object
49561
+ *
49562
+ * @param {*} val The value to test
49563
+ *
49564
+ * @returns {boolean} True if value is a plain Object, otherwise false
49565
+ */
49566
+ const isPlainObject = (val) => {
49567
+ if (kindOf(val) !== 'object') {
49568
+ return false;
49569
+ }
49570
+
49571
+ const prototype = getPrototypeOf(val);
49572
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
49573
+ }
49574
+
49575
+ /**
49576
+ * Determine if a value is a Date
49577
+ *
49578
+ * @param {*} val The value to test
49579
+ *
49580
+ * @returns {boolean} True if value is a Date, otherwise false
49581
+ */
49582
+ const isDate = kindOfTest('Date');
49583
+
49584
+ /**
49585
+ * Determine if a value is a File
49586
+ *
49587
+ * @param {*} val The value to test
49588
+ *
49589
+ * @returns {boolean} True if value is a File, otherwise false
49590
+ */
49591
+ const isFile = kindOfTest('File');
49592
+
49593
+ /**
49594
+ * Determine if a value is a Blob
49595
+ *
49596
+ * @param {*} val The value to test
49597
+ *
49598
+ * @returns {boolean} True if value is a Blob, otherwise false
49599
+ */
49600
+ const utils_isBlob = kindOfTest('Blob');
49601
+
49602
+ /**
49603
+ * Determine if a value is a FileList
49604
+ *
49605
+ * @param {*} val The value to test
49606
+ *
49607
+ * @returns {boolean} True if value is a File, otherwise false
49608
+ */
49609
+ const isFileList = kindOfTest('FileList');
49610
+
49611
+ /**
49612
+ * Determine if a value is a Stream
49613
+ *
49614
+ * @param {*} val The value to test
49615
+ *
49616
+ * @returns {boolean} True if value is a Stream, otherwise false
49617
+ */
49618
+ const isStream = (val) => isObject(val) && utils_isFunction(val.pipe);
49619
+
49620
+ /**
49621
+ * Determine if a value is a FormData
49622
+ *
49623
+ * @param {*} thing The value to test
49624
+ *
49625
+ * @returns {boolean} True if value is an FormData, otherwise false
49626
+ */
49627
+ const isFormData = (thing) => {
49628
+ let kind;
49629
+ return thing && (
49630
+ (typeof FormData === 'function' && thing instanceof FormData) || (
49631
+ utils_isFunction(thing.append) && (
49632
+ (kind = kindOf(thing)) === 'formdata' ||
49633
+ // detect form-data instance
49634
+ (kind === 'object' && utils_isFunction(thing.toString) && thing.toString() === '[object FormData]')
49635
+ )
49636
+ )
49637
+ )
49638
+ }
49639
+
49640
+ /**
49641
+ * Determine if a value is a URLSearchParams object
49642
+ *
49643
+ * @param {*} val The value to test
49644
+ *
49645
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
49646
+ */
49647
+ const isURLSearchParams = kindOfTest('URLSearchParams');
49648
+
49649
+ /**
49650
+ * Trim excess whitespace off the beginning and end of a string
49651
+ *
49652
+ * @param {String} str The String to trim
49653
+ *
49654
+ * @returns {String} The String freed of excess whitespace
49655
+ */
49656
+ const trim = (str) => str.trim ?
49657
+ str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
49658
+
49659
+ /**
49660
+ * Iterate over an Array or an Object invoking a function for each item.
49661
+ *
49662
+ * If `obj` is an Array callback will be called passing
49663
+ * the value, index, and complete array for each item.
49664
+ *
49665
+ * If 'obj' is an Object callback will be called passing
49666
+ * the value, key, and complete object for each property.
49667
+ *
49668
+ * @param {Object|Array} obj The object to iterate
49669
+ * @param {Function} fn The callback to invoke for each item
49670
+ *
49671
+ * @param {Boolean} [allOwnKeys = false]
49672
+ * @returns {any}
49673
+ */
49674
+ function utils_forEach(obj, fn, {allOwnKeys = false} = {}) {
49675
+ // Don't bother if no value provided
49676
+ if (obj === null || typeof obj === 'undefined') {
49677
+ return;
49678
+ }
49679
+
49680
+ let i;
49681
+ let l;
49682
+
49683
+ // Force an array if not already something iterable
49684
+ if (typeof obj !== 'object') {
49685
+ /*eslint no-param-reassign:0*/
49686
+ obj = [obj];
49687
+ }
49688
+
49689
+ if (utils_isArray(obj)) {
49690
+ // Iterate over array values
49691
+ for (i = 0, l = obj.length; i < l; i++) {
49692
+ fn.call(null, obj[i], i, obj);
49693
+ }
49694
+ } else {
49695
+ // Iterate over object keys
49696
+ const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
49697
+ const len = keys.length;
49698
+ let key;
49699
+
49700
+ for (i = 0; i < len; i++) {
49701
+ key = keys[i];
49702
+ fn.call(null, obj[key], key, obj);
49703
+ }
49704
+ }
49705
+ }
49706
+
49707
+ function findKey(obj, key) {
49708
+ key = key.toLowerCase();
49709
+ const keys = Object.keys(obj);
49710
+ let i = keys.length;
49711
+ let _key;
49712
+ while (i-- > 0) {
49713
+ _key = keys[i];
49714
+ if (key === _key.toLowerCase()) {
49715
+ return _key;
49716
+ }
49717
+ }
49718
+ return null;
49719
+ }
49720
+
49721
+ const _global = (() => {
49722
+ /*eslint no-undef:0*/
49723
+ if (typeof globalThis !== "undefined") return globalThis;
49724
+ return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
49725
+ })();
49726
+
49727
+ const isContextDefined = (context) => !isUndefined(context) && context !== _global;
49728
+
49729
+ /**
49730
+ * Accepts varargs expecting each argument to be an object, then
49731
+ * immutably merges the properties of each object and returns result.
49732
+ *
49733
+ * When multiple objects contain the same key the later object in
49734
+ * the arguments list will take precedence.
49735
+ *
49736
+ * Example:
49737
+ *
49738
+ * ```js
49739
+ * var result = merge({foo: 123}, {foo: 456});
49740
+ * console.log(result.foo); // outputs 456
49741
+ * ```
49742
+ *
49743
+ * @param {Object} obj1 Object to merge
49744
+ *
49745
+ * @returns {Object} Result of all merge properties
49746
+ */
49747
+ function merge(/* obj1, obj2, obj3, ... */) {
49748
+ const {caseless} = isContextDefined(this) && this || {};
49749
+ const result = {};
49750
+ const assignValue = (val, key) => {
49751
+ const targetKey = caseless && findKey(result, key) || key;
49752
+ if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
49753
+ result[targetKey] = merge(result[targetKey], val);
49754
+ } else if (isPlainObject(val)) {
49755
+ result[targetKey] = merge({}, val);
49756
+ } else if (utils_isArray(val)) {
49757
+ result[targetKey] = val.slice();
49758
+ } else {
49759
+ result[targetKey] = val;
49760
+ }
49761
+ }
49762
+
49763
+ for (let i = 0, l = arguments.length; i < l; i++) {
49764
+ arguments[i] && utils_forEach(arguments[i], assignValue);
49765
+ }
49766
+ return result;
49767
+ }
49768
+
49769
+ /**
49770
+ * Extends object a by mutably adding to it the properties of object b.
49771
+ *
49772
+ * @param {Object} a The object to be extended
49773
+ * @param {Object} b The object to copy properties from
49774
+ * @param {Object} thisArg The object to bind function to
49775
+ *
49776
+ * @param {Boolean} [allOwnKeys]
49777
+ * @returns {Object} The resulting value of object a
49778
+ */
49779
+ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
49780
+ utils_forEach(b, (val, key) => {
49781
+ if (thisArg && utils_isFunction(val)) {
49782
+ a[key] = bind_bind(val, thisArg);
49783
+ } else {
49784
+ a[key] = val;
49785
+ }
49786
+ }, {allOwnKeys});
49787
+ return a;
49788
+ }
49789
+
49790
+ /**
49791
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
49792
+ *
49793
+ * @param {string} content with BOM
49794
+ *
49795
+ * @returns {string} content value without BOM
49796
+ */
49797
+ const stripBOM = (content) => {
49798
+ if (content.charCodeAt(0) === 0xFEFF) {
49799
+ content = content.slice(1);
49800
+ }
49801
+ return content;
49802
+ }
49803
+
49804
+ /**
49805
+ * Inherit the prototype methods from one constructor into another
49806
+ * @param {function} constructor
49807
+ * @param {function} superConstructor
49808
+ * @param {object} [props]
49809
+ * @param {object} [descriptors]
49810
+ *
49811
+ * @returns {void}
49812
+ */
49813
+ const inherits = (constructor, superConstructor, props, descriptors) => {
49814
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
49815
+ constructor.prototype.constructor = constructor;
49816
+ Object.defineProperty(constructor, 'super', {
49817
+ value: superConstructor.prototype
49818
+ });
49819
+ props && Object.assign(constructor.prototype, props);
49820
+ }
49821
+
49822
+ /**
49823
+ * Resolve object with deep prototype chain to a flat object
49824
+ * @param {Object} sourceObj source object
49825
+ * @param {Object} [destObj]
49826
+ * @param {Function|Boolean} [filter]
49827
+ * @param {Function} [propFilter]
49828
+ *
49829
+ * @returns {Object}
49830
+ */
49831
+ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
49832
+ let props;
49833
+ let i;
49834
+ let prop;
49835
+ const merged = {};
49836
+
49837
+ destObj = destObj || {};
49838
+ // eslint-disable-next-line no-eq-null,eqeqeq
49839
+ if (sourceObj == null) return destObj;
49840
+
49841
+ do {
49842
+ props = Object.getOwnPropertyNames(sourceObj);
49843
+ i = props.length;
49844
+ while (i-- > 0) {
49845
+ prop = props[i];
49846
+ if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
49847
+ destObj[prop] = sourceObj[prop];
49848
+ merged[prop] = true;
49849
+ }
49850
+ }
49851
+ sourceObj = filter !== false && getPrototypeOf(sourceObj);
49852
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
49853
+
49854
+ return destObj;
49855
+ }
49856
+
49857
+ /**
49858
+ * Determines whether a string ends with the characters of a specified string
49859
+ *
49860
+ * @param {String} str
49861
+ * @param {String} searchString
49862
+ * @param {Number} [position= 0]
49863
+ *
49864
+ * @returns {boolean}
49865
+ */
49866
+ const utils_endsWith = (str, searchString, position) => {
49867
+ str = String(str);
49868
+ if (position === undefined || position > str.length) {
49869
+ position = str.length;
49870
+ }
49871
+ position -= searchString.length;
49872
+ const lastIndex = str.indexOf(searchString, position);
49873
+ return lastIndex !== -1 && lastIndex === position;
49874
+ }
49875
+
49876
+
49877
+ /**
49878
+ * Returns new array from array like object or null if failed
49879
+ *
49880
+ * @param {*} [thing]
49881
+ *
49882
+ * @returns {?Array}
49883
+ */
49884
+ const utils_toArray = (thing) => {
49885
+ if (!thing) return null;
49886
+ if (utils_isArray(thing)) return thing;
49887
+ let i = thing.length;
49888
+ if (!isNumber(i)) return null;
49889
+ const arr = new Array(i);
49890
+ while (i-- > 0) {
49891
+ arr[i] = thing[i];
49892
+ }
49893
+ return arr;
49894
+ }
49895
+
49896
+ /**
49897
+ * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
49898
+ * thing passed in is an instance of Uint8Array
49899
+ *
49900
+ * @param {TypedArray}
49901
+ *
49902
+ * @returns {Array}
49903
+ */
49904
+ // eslint-disable-next-line func-names
49905
+ const isTypedArray = (TypedArray => {
49906
+ // eslint-disable-next-line func-names
49907
+ return thing => {
49908
+ return TypedArray && thing instanceof TypedArray;
49909
+ };
49910
+ })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
49911
+
49912
+ /**
49913
+ * For each entry in the object, call the function with the key and value.
49914
+ *
49915
+ * @param {Object<any, any>} obj - The object to iterate over.
49916
+ * @param {Function} fn - The function to call for each entry.
49917
+ *
49918
+ * @returns {void}
49919
+ */
49920
+ const forEachEntry = (obj, fn) => {
49921
+ const generator = obj && obj[Symbol.iterator];
49922
+
49923
+ const iterator = generator.call(obj);
49924
+
49925
+ let result;
49926
+
49927
+ while ((result = iterator.next()) && !result.done) {
49928
+ const pair = result.value;
49929
+ fn.call(obj, pair[0], pair[1]);
49930
+ }
49931
+ }
49932
+
49933
+ /**
49934
+ * It takes a regular expression and a string, and returns an array of all the matches
49935
+ *
49936
+ * @param {string} regExp - The regular expression to match against.
49937
+ * @param {string} str - The string to search.
49938
+ *
49939
+ * @returns {Array<boolean>}
49940
+ */
49941
+ const matchAll = (regExp, str) => {
49942
+ let matches;
49943
+ const arr = [];
49944
+
49945
+ while ((matches = regExp.exec(str)) !== null) {
49946
+ arr.push(matches);
49947
+ }
49948
+
49949
+ return arr;
49950
+ }
49951
+
49952
+ /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
49953
+ const isHTMLForm = kindOfTest('HTMLFormElement');
49954
+
49955
+ const toCamelCase = str => {
49956
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
49957
+ function replacer(m, p1, p2) {
49958
+ return p1.toUpperCase() + p2;
49959
+ }
49960
+ );
49961
+ };
49962
+
49963
+ /* Creating a function that will check if an object has a property. */
49964
+ const utils_hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
49965
+
49966
+ /**
49967
+ * Determine if a value is a RegExp object
49968
+ *
49969
+ * @param {*} val The value to test
49970
+ *
49971
+ * @returns {boolean} True if value is a RegExp object, otherwise false
49972
+ */
49973
+ const isRegExp = kindOfTest('RegExp');
49974
+
49975
+ const reduceDescriptors = (obj, reducer) => {
49976
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
49977
+ const reducedDescriptors = {};
49978
+
49979
+ utils_forEach(descriptors, (descriptor, name) => {
49980
+ let ret;
49981
+ if ((ret = reducer(descriptor, name, obj)) !== false) {
49982
+ reducedDescriptors[name] = ret || descriptor;
49983
+ }
49984
+ });
49985
+
49986
+ Object.defineProperties(obj, reducedDescriptors);
49987
+ }
49988
+
49989
+ /**
49990
+ * Makes all methods read-only
49991
+ * @param {Object} obj
49992
+ */
49993
+
49994
+ const freezeMethods = (obj) => {
49995
+ reduceDescriptors(obj, (descriptor, name) => {
49996
+ // skip restricted props in strict mode
49997
+ if (utils_isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
49998
+ return false;
49999
+ }
50000
+
50001
+ const value = obj[name];
50002
+
50003
+ if (!utils_isFunction(value)) return;
50004
+
50005
+ descriptor.enumerable = false;
50006
+
50007
+ if ('writable' in descriptor) {
50008
+ descriptor.writable = false;
50009
+ return;
50010
+ }
50011
+
50012
+ if (!descriptor.set) {
50013
+ descriptor.set = () => {
50014
+ throw Error('Can not rewrite read-only method \'' + name + '\'');
50015
+ };
50016
+ }
50017
+ });
50018
+ }
50019
+
50020
+ const toObjectSet = (arrayOrString, delimiter) => {
50021
+ const obj = {};
50022
+
50023
+ const define = (arr) => {
50024
+ arr.forEach(value => {
50025
+ obj[value] = true;
50026
+ });
50027
+ }
50028
+
50029
+ utils_isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
50030
+
50031
+ return obj;
50032
+ }
50033
+
50034
+ const utils_noop = () => {}
50035
+
50036
+ const toFiniteNumber = (value, defaultValue) => {
50037
+ value = +value;
50038
+ return Number.isFinite(value) ? value : defaultValue;
50039
+ }
50040
+
50041
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
50042
+
50043
+ const DIGIT = '0123456789';
50044
+
50045
+ const ALPHABET = {
50046
+ DIGIT,
50047
+ ALPHA,
50048
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
50049
+ }
50050
+
50051
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
50052
+ let str = '';
50053
+ const {length} = alphabet;
50054
+ while (size--) {
50055
+ str += alphabet[Math.random() * length|0]
50056
+ }
50057
+
50058
+ return str;
50059
+ }
50060
+
50061
+ /**
50062
+ * If the thing is a FormData object, return true, otherwise return false.
50063
+ *
50064
+ * @param {unknown} thing - The thing to check.
50065
+ *
50066
+ * @returns {boolean}
50067
+ */
50068
+ function isSpecCompliantForm(thing) {
50069
+ return !!(thing && utils_isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
50070
+ }
50071
+
50072
+ const toJSONObject = (obj) => {
50073
+ const stack = new Array(10);
50074
+
50075
+ const visit = (source, i) => {
50076
+
50077
+ if (isObject(source)) {
50078
+ if (stack.indexOf(source) >= 0) {
50079
+ return;
50080
+ }
50081
+
50082
+ if(!('toJSON' in source)) {
50083
+ stack[i] = source;
50084
+ const target = utils_isArray(source) ? [] : {};
50085
+
50086
+ utils_forEach(source, (value, key) => {
50087
+ const reducedValue = visit(value, i + 1);
50088
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
50089
+ });
50090
+
50091
+ stack[i] = undefined;
50092
+
50093
+ return target;
50094
+ }
50095
+ }
50096
+
50097
+ return source;
50098
+ }
50099
+
50100
+ return visit(obj, 0);
50101
+ }
50102
+
50103
+ const isAsyncFn = kindOfTest('AsyncFunction');
50104
+
50105
+ const isThenable = (thing) =>
50106
+ thing && (isObject(thing) || utils_isFunction(thing)) && utils_isFunction(thing.then) && utils_isFunction(thing.catch);
50107
+
50108
+ /* harmony default export */ const utils = ({
50109
+ isArray: utils_isArray,
50110
+ isArrayBuffer,
50111
+ isBuffer,
50112
+ isFormData,
50113
+ isArrayBufferView,
50114
+ isString,
50115
+ isNumber,
50116
+ isBoolean,
50117
+ isObject,
50118
+ isPlainObject,
50119
+ isUndefined,
50120
+ isDate,
50121
+ isFile,
50122
+ isBlob: utils_isBlob,
50123
+ isRegExp,
50124
+ isFunction: utils_isFunction,
50125
+ isStream,
50126
+ isURLSearchParams,
50127
+ isTypedArray,
50128
+ isFileList,
50129
+ forEach: utils_forEach,
50130
+ merge,
50131
+ extend,
50132
+ trim,
50133
+ stripBOM,
50134
+ inherits,
50135
+ toFlatObject,
50136
+ kindOf,
50137
+ kindOfTest,
50138
+ endsWith: utils_endsWith,
50139
+ toArray: utils_toArray,
50140
+ forEachEntry,
50141
+ matchAll,
50142
+ isHTMLForm,
50143
+ hasOwnProperty: utils_hasOwnProperty,
50144
+ hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
50145
+ reduceDescriptors,
50146
+ freezeMethods,
50147
+ toObjectSet,
50148
+ toCamelCase,
50149
+ noop: utils_noop,
50150
+ toFiniteNumber,
50151
+ findKey,
50152
+ global: _global,
50153
+ isContextDefined,
50154
+ ALPHABET,
50155
+ generateString,
50156
+ isSpecCompliantForm,
50157
+ toJSONObject,
50158
+ isAsyncFn,
50159
+ isThenable
50160
+ });
50161
+
50162
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/AxiosError.js
50163
+
50164
+
50165
+
50166
+
50167
+ /**
50168
+ * Create an Error with the specified message, config, error code, request and response.
50169
+ *
50170
+ * @param {string} message The error message.
50171
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
50172
+ * @param {Object} [config] The config.
50173
+ * @param {Object} [request] The request.
50174
+ * @param {Object} [response] The response.
50175
+ *
50176
+ * @returns {Error} The created error.
50177
+ */
50178
+ function AxiosError(message, code, config, request, response) {
50179
+ Error.call(this);
50180
+
50181
+ if (Error.captureStackTrace) {
50182
+ Error.captureStackTrace(this, this.constructor);
50183
+ } else {
50184
+ this.stack = (new Error()).stack;
50185
+ }
50186
+
50187
+ this.message = message;
50188
+ this.name = 'AxiosError';
50189
+ code && (this.code = code);
50190
+ config && (this.config = config);
50191
+ request && (this.request = request);
50192
+ response && (this.response = response);
50193
+ }
50194
+
50195
+ utils.inherits(AxiosError, Error, {
50196
+ toJSON: function toJSON() {
50197
+ return {
50198
+ // Standard
50199
+ message: this.message,
50200
+ name: this.name,
50201
+ // Microsoft
50202
+ description: this.description,
50203
+ number: this.number,
50204
+ // Mozilla
50205
+ fileName: this.fileName,
50206
+ lineNumber: this.lineNumber,
50207
+ columnNumber: this.columnNumber,
50208
+ stack: this.stack,
50209
+ // Axios
50210
+ config: utils.toJSONObject(this.config),
50211
+ code: this.code,
50212
+ status: this.response && this.response.status ? this.response.status : null
50213
+ };
50214
+ }
50215
+ });
50216
+
50217
+ const AxiosError_prototype = AxiosError.prototype;
50218
+ const descriptors = {};
50219
+
50220
+ [
50221
+ 'ERR_BAD_OPTION_VALUE',
50222
+ 'ERR_BAD_OPTION',
50223
+ 'ECONNABORTED',
50224
+ 'ETIMEDOUT',
50225
+ 'ERR_NETWORK',
50226
+ 'ERR_FR_TOO_MANY_REDIRECTS',
50227
+ 'ERR_DEPRECATED',
50228
+ 'ERR_BAD_RESPONSE',
50229
+ 'ERR_BAD_REQUEST',
50230
+ 'ERR_CANCELED',
50231
+ 'ERR_NOT_SUPPORT',
50232
+ 'ERR_INVALID_URL'
50233
+ // eslint-disable-next-line func-names
50234
+ ].forEach(code => {
50235
+ descriptors[code] = {value: code};
50236
+ });
50237
+
50238
+ Object.defineProperties(AxiosError, descriptors);
50239
+ Object.defineProperty(AxiosError_prototype, 'isAxiosError', {value: true});
50240
+
50241
+ // eslint-disable-next-line func-names
50242
+ AxiosError.from = (error, code, config, request, response, customProps) => {
50243
+ const axiosError = Object.create(AxiosError_prototype);
50244
+
50245
+ utils.toFlatObject(error, axiosError, function filter(obj) {
50246
+ return obj !== Error.prototype;
50247
+ }, prop => {
50248
+ return prop !== 'isAxiosError';
50249
+ });
50250
+
50251
+ AxiosError.call(axiosError, error.message, code, config, request, response);
50252
+
50253
+ axiosError.cause = error;
50254
+
50255
+ axiosError.name = error.name;
50256
+
50257
+ customProps && Object.assign(axiosError, customProps);
50258
+
50259
+ return axiosError;
50260
+ };
50261
+
50262
+ /* harmony default export */ const core_AxiosError = (AxiosError);
50263
+
50264
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/null.js
50265
+ // eslint-disable-next-line strict
50266
+ /* harmony default export */ const helpers_null = (null);
50267
+
50268
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/toFormData.js
50269
+
50270
+
50271
+
50272
+
50273
+ // temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
50274
+
50275
+
50276
+ /**
50277
+ * Determines if the given thing is a array or js object.
50278
+ *
50279
+ * @param {string} thing - The object or array to be visited.
50280
+ *
50281
+ * @returns {boolean}
50282
+ */
50283
+ function isVisitable(thing) {
50284
+ return utils.isPlainObject(thing) || utils.isArray(thing);
50285
+ }
50286
+
50287
+ /**
50288
+ * It removes the brackets from the end of a string
50289
+ *
50290
+ * @param {string} key - The key of the parameter.
50291
+ *
50292
+ * @returns {string} the key without the brackets.
50293
+ */
50294
+ function removeBrackets(key) {
50295
+ return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
50296
+ }
50297
+
50298
+ /**
50299
+ * It takes a path, a key, and a boolean, and returns a string
50300
+ *
50301
+ * @param {string} path - The path to the current key.
50302
+ * @param {string} key - The key of the current object being iterated over.
50303
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
50304
+ *
50305
+ * @returns {string} The path to the current key.
50306
+ */
50307
+ function renderKey(path, key, dots) {
50308
+ if (!path) return key;
50309
+ return path.concat(key).map(function each(token, i) {
50310
+ // eslint-disable-next-line no-param-reassign
50311
+ token = removeBrackets(token);
50312
+ return !dots && i ? '[' + token + ']' : token;
50313
+ }).join(dots ? '.' : '');
50314
+ }
50315
+
50316
+ /**
50317
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
50318
+ *
50319
+ * @param {Array<any>} arr - The array to check
50320
+ *
50321
+ * @returns {boolean}
50322
+ */
50323
+ function isFlatArray(arr) {
50324
+ return utils.isArray(arr) && !arr.some(isVisitable);
50325
+ }
50326
+
50327
+ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
50328
+ return /^is[A-Z]/.test(prop);
50329
+ });
50330
+
50331
+ /**
50332
+ * Convert a data object to FormData
50333
+ *
50334
+ * @param {Object} obj
50335
+ * @param {?Object} [formData]
50336
+ * @param {?Object} [options]
50337
+ * @param {Function} [options.visitor]
50338
+ * @param {Boolean} [options.metaTokens = true]
50339
+ * @param {Boolean} [options.dots = false]
50340
+ * @param {?Boolean} [options.indexes = false]
50341
+ *
50342
+ * @returns {Object}
50343
+ **/
50344
+
50345
+ /**
50346
+ * It converts an object into a FormData object
50347
+ *
50348
+ * @param {Object<any, any>} obj - The object to convert to form data.
50349
+ * @param {string} formData - The FormData object to append to.
50350
+ * @param {Object<string, any>} options
50351
+ *
50352
+ * @returns
50353
+ */
50354
+ function toFormData(obj, formData, options) {
50355
+ if (!utils.isObject(obj)) {
50356
+ throw new TypeError('target must be an object');
50357
+ }
50358
+
50359
+ // eslint-disable-next-line no-param-reassign
50360
+ formData = formData || new (helpers_null || FormData)();
50361
+
50362
+ // eslint-disable-next-line no-param-reassign
50363
+ options = utils.toFlatObject(options, {
50364
+ metaTokens: true,
50365
+ dots: false,
50366
+ indexes: false
50367
+ }, false, function defined(option, source) {
50368
+ // eslint-disable-next-line no-eq-null,eqeqeq
50369
+ return !utils.isUndefined(source[option]);
50370
+ });
50371
+
50372
+ const metaTokens = options.metaTokens;
50373
+ // eslint-disable-next-line no-use-before-define
50374
+ const visitor = options.visitor || defaultVisitor;
50375
+ const dots = options.dots;
50376
+ const indexes = options.indexes;
50377
+ const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
50378
+ const useBlob = _Blob && utils.isSpecCompliantForm(formData);
50379
+
50380
+ if (!utils.isFunction(visitor)) {
50381
+ throw new TypeError('visitor must be a function');
50382
+ }
50383
+
50384
+ function convertValue(value) {
50385
+ if (value === null) return '';
50386
+
50387
+ if (utils.isDate(value)) {
50388
+ return value.toISOString();
50389
+ }
50390
+
50391
+ if (!useBlob && utils.isBlob(value)) {
50392
+ throw new core_AxiosError('Blob is not supported. Use a Buffer instead.');
50393
+ }
50394
+
50395
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
50396
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
50397
+ }
50398
+
50399
+ return value;
50400
+ }
50401
+
50402
+ /**
50403
+ * Default visitor.
50404
+ *
50405
+ * @param {*} value
50406
+ * @param {String|Number} key
50407
+ * @param {Array<String|Number>} path
50408
+ * @this {FormData}
50409
+ *
50410
+ * @returns {boolean} return true to visit the each prop of the value recursively
50411
+ */
50412
+ function defaultVisitor(value, key, path) {
50413
+ let arr = value;
50414
+
50415
+ if (value && !path && typeof value === 'object') {
50416
+ if (utils.endsWith(key, '{}')) {
50417
+ // eslint-disable-next-line no-param-reassign
50418
+ key = metaTokens ? key : key.slice(0, -2);
50419
+ // eslint-disable-next-line no-param-reassign
50420
+ value = JSON.stringify(value);
50421
+ } else if (
50422
+ (utils.isArray(value) && isFlatArray(value)) ||
50423
+ ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
50424
+ )) {
50425
+ // eslint-disable-next-line no-param-reassign
50426
+ key = removeBrackets(key);
50427
+
50428
+ arr.forEach(function each(el, index) {
50429
+ !(utils.isUndefined(el) || el === null) && formData.append(
50430
+ // eslint-disable-next-line no-nested-ternary
50431
+ indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
50432
+ convertValue(el)
50433
+ );
50434
+ });
50435
+ return false;
50436
+ }
50437
+ }
50438
+
50439
+ if (isVisitable(value)) {
50440
+ return true;
50441
+ }
50442
+
50443
+ formData.append(renderKey(path, key, dots), convertValue(value));
50444
+
50445
+ return false;
50446
+ }
50447
+
50448
+ const stack = [];
50449
+
50450
+ const exposedHelpers = Object.assign(predicates, {
50451
+ defaultVisitor,
50452
+ convertValue,
50453
+ isVisitable
50454
+ });
50455
+
50456
+ function build(value, path) {
50457
+ if (utils.isUndefined(value)) return;
50458
+
50459
+ if (stack.indexOf(value) !== -1) {
50460
+ throw Error('Circular reference detected in ' + path.join('.'));
50461
+ }
50462
+
50463
+ stack.push(value);
50464
+
50465
+ utils.forEach(value, function each(el, key) {
50466
+ const result = !(utils.isUndefined(el) || el === null) && visitor.call(
50467
+ formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
50468
+ );
50469
+
50470
+ if (result === true) {
50471
+ build(el, path ? path.concat(key) : [key]);
50472
+ }
50473
+ });
50474
+
50475
+ stack.pop();
50476
+ }
50477
+
50478
+ if (!utils.isObject(obj)) {
50479
+ throw new TypeError('data must be an object');
50480
+ }
50481
+
50482
+ build(obj);
50483
+
50484
+ return formData;
50485
+ }
50486
+
50487
+ /* harmony default export */ const helpers_toFormData = (toFormData);
50488
+
50489
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/AxiosURLSearchParams.js
50490
+
50491
+
50492
+
50493
+
50494
+ /**
50495
+ * It encodes a string by replacing all characters that are not in the unreserved set with
50496
+ * their percent-encoded equivalents
50497
+ *
50498
+ * @param {string} str - The string to encode.
50499
+ *
50500
+ * @returns {string} The encoded string.
50501
+ */
50502
+ function encode(str) {
50503
+ const charMap = {
50504
+ '!': '%21',
50505
+ "'": '%27',
50506
+ '(': '%28',
50507
+ ')': '%29',
50508
+ '~': '%7E',
50509
+ '%20': '+',
50510
+ '%00': '\x00'
50511
+ };
50512
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
50513
+ return charMap[match];
50514
+ });
50515
+ }
50516
+
50517
+ /**
50518
+ * It takes a params object and converts it to a FormData object
50519
+ *
50520
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
50521
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
50522
+ *
50523
+ * @returns {void}
50524
+ */
50525
+ function AxiosURLSearchParams(params, options) {
50526
+ this._pairs = [];
50527
+
50528
+ params && helpers_toFormData(params, this, options);
50529
+ }
50530
+
50531
+ const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype;
50532
+
50533
+ AxiosURLSearchParams_prototype.append = function append(name, value) {
50534
+ this._pairs.push([name, value]);
50535
+ };
50536
+
50537
+ AxiosURLSearchParams_prototype.toString = function toString(encoder) {
50538
+ const _encode = encoder ? function(value) {
50539
+ return encoder.call(this, value, encode);
50540
+ } : encode;
50541
+
50542
+ return this._pairs.map(function each(pair) {
50543
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
50544
+ }, '').join('&');
50545
+ };
50546
+
50547
+ /* harmony default export */ const helpers_AxiosURLSearchParams = (AxiosURLSearchParams);
50548
+
50549
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/buildURL.js
50550
+
50551
+
50552
+
50553
+
50554
+
50555
+ /**
50556
+ * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
50557
+ * URI encoded counterparts
50558
+ *
50559
+ * @param {string} val The value to be encoded.
50560
+ *
50561
+ * @returns {string} The encoded value.
50562
+ */
50563
+ function buildURL_encode(val) {
50564
+ return encodeURIComponent(val).
50565
+ replace(/%3A/gi, ':').
50566
+ replace(/%24/g, '$').
50567
+ replace(/%2C/gi, ',').
50568
+ replace(/%20/g, '+').
50569
+ replace(/%5B/gi, '[').
50570
+ replace(/%5D/gi, ']');
50571
+ }
50572
+
50573
+ /**
50574
+ * Build a URL by appending params to the end
50575
+ *
50576
+ * @param {string} url The base of the url (e.g., http://www.google.com)
50577
+ * @param {object} [params] The params to be appended
50578
+ * @param {?object} options
50579
+ *
50580
+ * @returns {string} The formatted url
50581
+ */
50582
+ function buildURL(url, params, options) {
50583
+ /*eslint no-param-reassign:0*/
50584
+ if (!params) {
50585
+ return url;
50586
+ }
50587
+
50588
+ const _encode = options && options.encode || buildURL_encode;
50589
+
50590
+ const serializeFn = options && options.serialize;
50591
+
50592
+ let serializedParams;
50593
+
50594
+ if (serializeFn) {
50595
+ serializedParams = serializeFn(params, options);
50596
+ } else {
50597
+ serializedParams = utils.isURLSearchParams(params) ?
50598
+ params.toString() :
50599
+ new helpers_AxiosURLSearchParams(params, options).toString(_encode);
50600
+ }
50601
+
50602
+ if (serializedParams) {
50603
+ const hashmarkIndex = url.indexOf("#");
50604
+
50605
+ if (hashmarkIndex !== -1) {
50606
+ url = url.slice(0, hashmarkIndex);
50607
+ }
50608
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
50609
+ }
50610
+
50611
+ return url;
50612
+ }
50613
+
50614
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/InterceptorManager.js
50615
+
50616
+
50617
+
50618
+
50619
+ class InterceptorManager {
50620
+ constructor() {
50621
+ this.handlers = [];
50622
+ }
50623
+
50624
+ /**
50625
+ * Add a new interceptor to the stack
50626
+ *
50627
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
50628
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
50629
+ *
50630
+ * @return {Number} An ID used to remove interceptor later
50631
+ */
50632
+ use(fulfilled, rejected, options) {
50633
+ this.handlers.push({
50634
+ fulfilled,
50635
+ rejected,
50636
+ synchronous: options ? options.synchronous : false,
50637
+ runWhen: options ? options.runWhen : null
50638
+ });
50639
+ return this.handlers.length - 1;
50640
+ }
50641
+
50642
+ /**
50643
+ * Remove an interceptor from the stack
50644
+ *
50645
+ * @param {Number} id The ID that was returned by `use`
50646
+ *
50647
+ * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
50648
+ */
50649
+ eject(id) {
50650
+ if (this.handlers[id]) {
50651
+ this.handlers[id] = null;
50652
+ }
50653
+ }
50654
+
50655
+ /**
50656
+ * Clear all interceptors from the stack
50657
+ *
50658
+ * @returns {void}
50659
+ */
50660
+ clear() {
50661
+ if (this.handlers) {
50662
+ this.handlers = [];
50663
+ }
50664
+ }
50665
+
50666
+ /**
50667
+ * Iterate over all the registered interceptors
50668
+ *
50669
+ * This method is particularly useful for skipping over any
50670
+ * interceptors that may have become `null` calling `eject`.
50671
+ *
50672
+ * @param {Function} fn The function to call for each interceptor
50673
+ *
50674
+ * @returns {void}
50675
+ */
50676
+ forEach(fn) {
50677
+ utils.forEach(this.handlers, function forEachHandler(h) {
50678
+ if (h !== null) {
50679
+ fn(h);
50680
+ }
50681
+ });
50682
+ }
50683
+ }
50684
+
50685
+ /* harmony default export */ const core_InterceptorManager = (InterceptorManager);
50686
+
50687
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/defaults/transitional.js
50688
+
50689
+
50690
+ /* harmony default export */ const defaults_transitional = ({
50691
+ silentJSONParsing: true,
50692
+ forcedJSONParsing: true,
50693
+ clarifyTimeoutError: false
50694
+ });
50695
+
50696
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
50697
+
50698
+
50699
+
50700
+ /* harmony default export */ const classes_URLSearchParams = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : helpers_AxiosURLSearchParams);
50701
+
50702
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/platform/browser/classes/FormData.js
50703
+
50704
+
50705
+ /* harmony default export */ const classes_FormData = (typeof FormData !== 'undefined' ? FormData : null);
50706
+
50707
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/platform/browser/classes/Blob.js
50708
+
50709
+
50710
+ /* harmony default export */ const classes_Blob = (typeof Blob !== 'undefined' ? Blob : null);
50711
+
50712
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/platform/browser/index.js
50713
+
50714
+
50715
+
50716
+
50717
+ /* harmony default export */ const browser = ({
50718
+ isBrowser: true,
50719
+ classes: {
50720
+ URLSearchParams: classes_URLSearchParams,
50721
+ FormData: classes_FormData,
50722
+ Blob: classes_Blob
50723
+ },
50724
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
50725
+ });
50726
+
50727
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/platform/common/utils.js
50728
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
50729
+
50730
+ /**
50731
+ * Determine if we're running in a standard browser environment
50732
+ *
50733
+ * This allows axios to run in a web worker, and react-native.
50734
+ * Both environments support XMLHttpRequest, but not fully standard globals.
50735
+ *
50736
+ * web workers:
50737
+ * typeof window -> undefined
50738
+ * typeof document -> undefined
50739
+ *
50740
+ * react-native:
50741
+ * navigator.product -> 'ReactNative'
50742
+ * nativescript
50743
+ * navigator.product -> 'NativeScript' or 'NS'
50744
+ *
50745
+ * @returns {boolean}
50746
+ */
50747
+ const hasStandardBrowserEnv = (
50748
+ (product) => {
50749
+ return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
50750
+ })(typeof navigator !== 'undefined' && navigator.product);
50751
+
50752
+ /**
50753
+ * Determine if we're running in a standard browser webWorker environment
50754
+ *
50755
+ * Although the `isStandardBrowserEnv` method indicates that
50756
+ * `allows axios to run in a web worker`, the WebWorker will still be
50757
+ * filtered out due to its judgment standard
50758
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
50759
+ * This leads to a problem when axios post `FormData` in webWorker
50760
+ */
50761
+ const hasStandardBrowserWebWorkerEnv = (() => {
50762
+ return (
50763
+ typeof WorkerGlobalScope !== 'undefined' &&
50764
+ // eslint-disable-next-line no-undef
50765
+ self instanceof WorkerGlobalScope &&
50766
+ typeof self.importScripts === 'function'
50767
+ );
50768
+ })();
50769
+
50770
+
50771
+
50772
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/platform/index.js
50773
+
50774
+
50775
+
50776
+ /* harmony default export */ const platform = ({
50777
+ ...common_utils_namespaceObject,
50778
+ ...browser
50779
+ });
50780
+
50781
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/toURLEncodedForm.js
50782
+
50783
+
50784
+
50785
+
50786
+
50787
+
50788
+ function toURLEncodedForm(data, options) {
50789
+ return helpers_toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
50790
+ visitor: function(value, key, path, helpers) {
50791
+ if (platform.isNode && utils.isBuffer(value)) {
50792
+ this.append(key, value.toString('base64'));
50793
+ return false;
50794
+ }
50795
+
50796
+ return helpers.defaultVisitor.apply(this, arguments);
50797
+ }
50798
+ }, options));
50799
+ }
50800
+
50801
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/formDataToJSON.js
50802
+
50803
+
50804
+
50805
+
50806
+ /**
50807
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
50808
+ *
50809
+ * @param {string} name - The name of the property to get.
50810
+ *
50811
+ * @returns An array of strings.
50812
+ */
50813
+ function parsePropPath(name) {
50814
+ // foo[x][y][z]
50815
+ // foo.x.y.z
50816
+ // foo-x-y-z
50817
+ // foo x y z
50818
+ return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
50819
+ return match[0] === '[]' ? '' : match[1] || match[0];
50820
+ });
50821
+ }
50822
+
50823
+ /**
50824
+ * Convert an array to an object.
50825
+ *
50826
+ * @param {Array<any>} arr - The array to convert to an object.
50827
+ *
50828
+ * @returns An object with the same keys and values as the array.
50829
+ */
50830
+ function arrayToObject(arr) {
50831
+ const obj = {};
50832
+ const keys = Object.keys(arr);
50833
+ let i;
50834
+ const len = keys.length;
50835
+ let key;
50836
+ for (i = 0; i < len; i++) {
50837
+ key = keys[i];
50838
+ obj[key] = arr[key];
50839
+ }
50840
+ return obj;
50841
+ }
50842
+
50843
+ /**
50844
+ * It takes a FormData object and returns a JavaScript object
50845
+ *
50846
+ * @param {string} formData The FormData object to convert to JSON.
50847
+ *
50848
+ * @returns {Object<string, any> | null} The converted object.
50849
+ */
50850
+ function formDataToJSON(formData) {
50851
+ function buildPath(path, value, target, index) {
50852
+ let name = path[index++];
50853
+ const isNumericKey = Number.isFinite(+name);
50854
+ const isLast = index >= path.length;
50855
+ name = !name && utils.isArray(target) ? target.length : name;
50856
+
50857
+ if (isLast) {
50858
+ if (utils.hasOwnProp(target, name)) {
50859
+ target[name] = [target[name], value];
50860
+ } else {
50861
+ target[name] = value;
50862
+ }
50863
+
50864
+ return !isNumericKey;
50865
+ }
50866
+
50867
+ if (!target[name] || !utils.isObject(target[name])) {
50868
+ target[name] = [];
50869
+ }
50870
+
50871
+ const result = buildPath(path, value, target[name], index);
50872
+
50873
+ if (result && utils.isArray(target[name])) {
50874
+ target[name] = arrayToObject(target[name]);
50875
+ }
50876
+
50877
+ return !isNumericKey;
50878
+ }
50879
+
50880
+ if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
50881
+ const obj = {};
50882
+
50883
+ utils.forEachEntry(formData, (name, value) => {
50884
+ buildPath(parsePropPath(name), value, obj, 0);
50885
+ });
50886
+
50887
+ return obj;
50888
+ }
50889
+
50890
+ return null;
50891
+ }
50892
+
50893
+ /* harmony default export */ const helpers_formDataToJSON = (formDataToJSON);
50894
+
50895
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/defaults/index.js
50896
+
50897
+
50898
+
50899
+
50900
+
50901
+
50902
+
50903
+
50904
+
50905
+
50906
+ /**
50907
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
50908
+ * of the input
50909
+ *
50910
+ * @param {any} rawValue - The value to be stringified.
50911
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
50912
+ * @param {Function} encoder - A function that takes a value and returns a string.
50913
+ *
50914
+ * @returns {string} A stringified version of the rawValue.
50915
+ */
50916
+ function stringifySafely(rawValue, parser, encoder) {
50917
+ if (utils.isString(rawValue)) {
50918
+ try {
50919
+ (parser || JSON.parse)(rawValue);
50920
+ return utils.trim(rawValue);
50921
+ } catch (e) {
50922
+ if (e.name !== 'SyntaxError') {
50923
+ throw e;
50924
+ }
50925
+ }
50926
+ }
50927
+
50928
+ return (encoder || JSON.stringify)(rawValue);
50929
+ }
50930
+
50931
+ const defaults = {
50932
+
50933
+ transitional: defaults_transitional,
50934
+
50935
+ adapter: ['xhr', 'http'],
50936
+
50937
+ transformRequest: [function transformRequest(data, headers) {
50938
+ const contentType = headers.getContentType() || '';
50939
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
50940
+ const isObjectPayload = utils.isObject(data);
50941
+
50942
+ if (isObjectPayload && utils.isHTMLForm(data)) {
50943
+ data = new FormData(data);
50944
+ }
50945
+
50946
+ const isFormData = utils.isFormData(data);
50947
+
50948
+ if (isFormData) {
50949
+ if (!hasJSONContentType) {
50950
+ return data;
50951
+ }
50952
+ return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data;
50953
+ }
50954
+
50955
+ if (utils.isArrayBuffer(data) ||
50956
+ utils.isBuffer(data) ||
50957
+ utils.isStream(data) ||
50958
+ utils.isFile(data) ||
50959
+ utils.isBlob(data)
50960
+ ) {
50961
+ return data;
50962
+ }
50963
+ if (utils.isArrayBufferView(data)) {
50964
+ return data.buffer;
50965
+ }
50966
+ if (utils.isURLSearchParams(data)) {
50967
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
50968
+ return data.toString();
50969
+ }
50970
+
50971
+ let isFileList;
50972
+
50973
+ if (isObjectPayload) {
50974
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
50975
+ return toURLEncodedForm(data, this.formSerializer).toString();
50976
+ }
50977
+
50978
+ if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
50979
+ const _FormData = this.env && this.env.FormData;
50980
+
50981
+ return helpers_toFormData(
50982
+ isFileList ? {'files[]': data} : data,
50983
+ _FormData && new _FormData(),
50984
+ this.formSerializer
50985
+ );
50986
+ }
50987
+ }
50988
+
50989
+ if (isObjectPayload || hasJSONContentType ) {
50990
+ headers.setContentType('application/json', false);
50991
+ return stringifySafely(data);
50992
+ }
50993
+
50994
+ return data;
50995
+ }],
50996
+
50997
+ transformResponse: [function transformResponse(data) {
50998
+ const transitional = this.transitional || defaults.transitional;
50999
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
51000
+ const JSONRequested = this.responseType === 'json';
51001
+
51002
+ if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
51003
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
51004
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
51005
+
51006
+ try {
51007
+ return JSON.parse(data);
51008
+ } catch (e) {
51009
+ if (strictJSONParsing) {
51010
+ if (e.name === 'SyntaxError') {
51011
+ throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
51012
+ }
51013
+ throw e;
51014
+ }
51015
+ }
51016
+ }
51017
+
51018
+ return data;
51019
+ }],
51020
+
51021
+ /**
51022
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
51023
+ * timeout is not created.
51024
+ */
51025
+ timeout: 0,
51026
+
51027
+ xsrfCookieName: 'XSRF-TOKEN',
51028
+ xsrfHeaderName: 'X-XSRF-TOKEN',
51029
+
51030
+ maxContentLength: -1,
51031
+ maxBodyLength: -1,
51032
+
51033
+ env: {
51034
+ FormData: platform.classes.FormData,
51035
+ Blob: platform.classes.Blob
51036
+ },
51037
+
51038
+ validateStatus: function validateStatus(status) {
51039
+ return status >= 200 && status < 300;
51040
+ },
51041
+
51042
+ headers: {
51043
+ common: {
51044
+ 'Accept': 'application/json, text/plain, */*',
51045
+ 'Content-Type': undefined
51046
+ }
51047
+ }
51048
+ };
51049
+
51050
+ utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
51051
+ defaults.headers[method] = {};
51052
+ });
51053
+
51054
+ /* harmony default export */ const lib_defaults = (defaults);
51055
+
51056
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/parseHeaders.js
51057
+
51058
+
51059
+
51060
+
51061
+ // RawAxiosHeaders whose duplicates are ignored by node
51062
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
51063
+ const ignoreDuplicateOf = utils.toObjectSet([
51064
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
51065
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
51066
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
51067
+ 'referer', 'retry-after', 'user-agent'
51068
+ ]);
51069
+
51070
+ /**
51071
+ * Parse headers into an object
51072
+ *
51073
+ * ```
51074
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
51075
+ * Content-Type: application/json
51076
+ * Connection: keep-alive
51077
+ * Transfer-Encoding: chunked
51078
+ * ```
51079
+ *
51080
+ * @param {String} rawHeaders Headers needing to be parsed
51081
+ *
51082
+ * @returns {Object} Headers parsed into an object
51083
+ */
51084
+ /* harmony default export */ const helpers_parseHeaders = (rawHeaders => {
51085
+ const parsed = {};
51086
+ let key;
51087
+ let val;
51088
+ let i;
51089
+
51090
+ rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
51091
+ i = line.indexOf(':');
51092
+ key = line.substring(0, i).trim().toLowerCase();
51093
+ val = line.substring(i + 1).trim();
51094
+
51095
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
51096
+ return;
51097
+ }
51098
+
51099
+ if (key === 'set-cookie') {
51100
+ if (parsed[key]) {
51101
+ parsed[key].push(val);
51102
+ } else {
51103
+ parsed[key] = [val];
51104
+ }
51105
+ } else {
51106
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
51107
+ }
51108
+ });
51109
+
51110
+ return parsed;
51111
+ });
51112
+
51113
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/AxiosHeaders.js
51114
+
51115
+
51116
+
51117
+
51118
+
51119
+ const $internals = Symbol('internals');
51120
+
51121
+ function normalizeHeader(header) {
51122
+ return header && String(header).trim().toLowerCase();
51123
+ }
51124
+
51125
+ function normalizeValue(value) {
51126
+ if (value === false || value == null) {
51127
+ return value;
51128
+ }
51129
+
51130
+ return utils.isArray(value) ? value.map(normalizeValue) : String(value);
51131
+ }
51132
+
51133
+ function parseTokens(str) {
51134
+ const tokens = Object.create(null);
51135
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
51136
+ let match;
51137
+
51138
+ while ((match = tokensRE.exec(str))) {
51139
+ tokens[match[1]] = match[2];
51140
+ }
51141
+
51142
+ return tokens;
51143
+ }
51144
+
51145
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
51146
+
51147
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
51148
+ if (utils.isFunction(filter)) {
51149
+ return filter.call(this, value, header);
51150
+ }
51151
+
51152
+ if (isHeaderNameFilter) {
51153
+ value = header;
51154
+ }
51155
+
51156
+ if (!utils.isString(value)) return;
51157
+
51158
+ if (utils.isString(filter)) {
51159
+ return value.indexOf(filter) !== -1;
51160
+ }
51161
+
51162
+ if (utils.isRegExp(filter)) {
51163
+ return filter.test(value);
51164
+ }
51165
+ }
51166
+
51167
+ function formatHeader(header) {
51168
+ return header.trim()
51169
+ .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
51170
+ return char.toUpperCase() + str;
51171
+ });
51172
+ }
51173
+
51174
+ function buildAccessors(obj, header) {
51175
+ const accessorName = utils.toCamelCase(' ' + header);
51176
+
51177
+ ['get', 'set', 'has'].forEach(methodName => {
51178
+ Object.defineProperty(obj, methodName + accessorName, {
51179
+ value: function(arg1, arg2, arg3) {
51180
+ return this[methodName].call(this, header, arg1, arg2, arg3);
51181
+ },
51182
+ configurable: true
51183
+ });
51184
+ });
51185
+ }
51186
+
51187
+ class AxiosHeaders {
51188
+ constructor(headers) {
51189
+ headers && this.set(headers);
51190
+ }
51191
+
51192
+ set(header, valueOrRewrite, rewrite) {
51193
+ const self = this;
51194
+
51195
+ function setHeader(_value, _header, _rewrite) {
51196
+ const lHeader = normalizeHeader(_header);
51197
+
51198
+ if (!lHeader) {
51199
+ throw new Error('header name must be a non-empty string');
51200
+ }
51201
+
51202
+ const key = utils.findKey(self, lHeader);
51203
+
51204
+ if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
51205
+ self[key || _header] = normalizeValue(_value);
51206
+ }
51207
+ }
51208
+
51209
+ const setHeaders = (headers, _rewrite) =>
51210
+ utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
51211
+
51212
+ if (utils.isPlainObject(header) || header instanceof this.constructor) {
51213
+ setHeaders(header, valueOrRewrite)
51214
+ } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
51215
+ setHeaders(helpers_parseHeaders(header), valueOrRewrite);
51216
+ } else {
51217
+ header != null && setHeader(valueOrRewrite, header, rewrite);
51218
+ }
51219
+
51220
+ return this;
51221
+ }
51222
+
51223
+ get(header, parser) {
51224
+ header = normalizeHeader(header);
51225
+
51226
+ if (header) {
51227
+ const key = utils.findKey(this, header);
51228
+
51229
+ if (key) {
51230
+ const value = this[key];
51231
+
51232
+ if (!parser) {
51233
+ return value;
51234
+ }
51235
+
51236
+ if (parser === true) {
51237
+ return parseTokens(value);
51238
+ }
51239
+
51240
+ if (utils.isFunction(parser)) {
51241
+ return parser.call(this, value, key);
51242
+ }
51243
+
51244
+ if (utils.isRegExp(parser)) {
51245
+ return parser.exec(value);
51246
+ }
51247
+
51248
+ throw new TypeError('parser must be boolean|regexp|function');
51249
+ }
51250
+ }
51251
+ }
51252
+
51253
+ has(header, matcher) {
51254
+ header = normalizeHeader(header);
51255
+
51256
+ if (header) {
51257
+ const key = utils.findKey(this, header);
51258
+
51259
+ return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
51260
+ }
51261
+
51262
+ return false;
51263
+ }
51264
+
51265
+ delete(header, matcher) {
51266
+ const self = this;
51267
+ let deleted = false;
51268
+
51269
+ function deleteHeader(_header) {
51270
+ _header = normalizeHeader(_header);
51271
+
51272
+ if (_header) {
51273
+ const key = utils.findKey(self, _header);
51274
+
51275
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
51276
+ delete self[key];
51277
+
51278
+ deleted = true;
51279
+ }
51280
+ }
51281
+ }
51282
+
51283
+ if (utils.isArray(header)) {
51284
+ header.forEach(deleteHeader);
51285
+ } else {
51286
+ deleteHeader(header);
51287
+ }
51288
+
51289
+ return deleted;
51290
+ }
51291
+
51292
+ clear(matcher) {
51293
+ const keys = Object.keys(this);
51294
+ let i = keys.length;
51295
+ let deleted = false;
51296
+
51297
+ while (i--) {
51298
+ const key = keys[i];
51299
+ if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
51300
+ delete this[key];
51301
+ deleted = true;
51302
+ }
51303
+ }
51304
+
51305
+ return deleted;
51306
+ }
51307
+
51308
+ normalize(format) {
51309
+ const self = this;
51310
+ const headers = {};
51311
+
51312
+ utils.forEach(this, (value, header) => {
51313
+ const key = utils.findKey(headers, header);
51314
+
51315
+ if (key) {
51316
+ self[key] = normalizeValue(value);
51317
+ delete self[header];
51318
+ return;
51319
+ }
51320
+
51321
+ const normalized = format ? formatHeader(header) : String(header).trim();
51322
+
51323
+ if (normalized !== header) {
51324
+ delete self[header];
51325
+ }
51326
+
51327
+ self[normalized] = normalizeValue(value);
51328
+
51329
+ headers[normalized] = true;
51330
+ });
51331
+
51332
+ return this;
51333
+ }
51334
+
51335
+ concat(...targets) {
51336
+ return this.constructor.concat(this, ...targets);
51337
+ }
51338
+
51339
+ toJSON(asStrings) {
51340
+ const obj = Object.create(null);
51341
+
51342
+ utils.forEach(this, (value, header) => {
51343
+ value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
51344
+ });
51345
+
51346
+ return obj;
51347
+ }
51348
+
51349
+ [Symbol.iterator]() {
51350
+ return Object.entries(this.toJSON())[Symbol.iterator]();
51351
+ }
51352
+
51353
+ toString() {
51354
+ return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
51355
+ }
51356
+
51357
+ get [Symbol.toStringTag]() {
51358
+ return 'AxiosHeaders';
51359
+ }
51360
+
51361
+ static from(thing) {
51362
+ return thing instanceof this ? thing : new this(thing);
51363
+ }
51364
+
51365
+ static concat(first, ...targets) {
51366
+ const computed = new this(first);
51367
+
51368
+ targets.forEach((target) => computed.set(target));
51369
+
51370
+ return computed;
51371
+ }
51372
+
51373
+ static accessor(header) {
51374
+ const internals = this[$internals] = (this[$internals] = {
51375
+ accessors: {}
51376
+ });
51377
+
51378
+ const accessors = internals.accessors;
51379
+ const prototype = this.prototype;
51380
+
51381
+ function defineAccessor(_header) {
51382
+ const lHeader = normalizeHeader(_header);
51383
+
51384
+ if (!accessors[lHeader]) {
51385
+ buildAccessors(prototype, _header);
51386
+ accessors[lHeader] = true;
51387
+ }
51388
+ }
51389
+
51390
+ utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
51391
+
51392
+ return this;
51393
+ }
51394
+ }
51395
+
51396
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
51397
+
51398
+ // reserved names hotfix
51399
+ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
51400
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
51401
+ return {
51402
+ get: () => value,
51403
+ set(headerValue) {
51404
+ this[mapped] = headerValue;
51405
+ }
51406
+ }
51407
+ });
51408
+
51409
+ utils.freezeMethods(AxiosHeaders);
51410
+
51411
+ /* harmony default export */ const core_AxiosHeaders = (AxiosHeaders);
51412
+
51413
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/transformData.js
51414
+
51415
+
51416
+
51417
+
51418
+
51419
+
51420
+ /**
51421
+ * Transform the data for a request or a response
51422
+ *
51423
+ * @param {Array|Function} fns A single function or Array of functions
51424
+ * @param {?Object} response The response object
51425
+ *
51426
+ * @returns {*} The resulting transformed data
51427
+ */
51428
+ function transformData(fns, response) {
51429
+ const config = this || lib_defaults;
51430
+ const context = response || config;
51431
+ const headers = core_AxiosHeaders.from(context.headers);
51432
+ let data = context.data;
51433
+
51434
+ utils.forEach(fns, function transform(fn) {
51435
+ data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
51436
+ });
51437
+
51438
+ headers.normalize();
51439
+
51440
+ return data;
51441
+ }
51442
+
51443
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/cancel/isCancel.js
51444
+
51445
+
51446
+ function isCancel(value) {
51447
+ return !!(value && value.__CANCEL__);
51448
+ }
51449
+
51450
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/cancel/CanceledError.js
51451
+
51452
+
51453
+
51454
+
51455
+
51456
+ /**
51457
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
51458
+ *
51459
+ * @param {string=} message The message.
51460
+ * @param {Object=} config The config.
51461
+ * @param {Object=} request The request.
51462
+ *
51463
+ * @returns {CanceledError} The created error.
51464
+ */
51465
+ function CanceledError(message, config, request) {
51466
+ // eslint-disable-next-line no-eq-null,eqeqeq
51467
+ core_AxiosError.call(this, message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request);
51468
+ this.name = 'CanceledError';
51469
+ }
51470
+
51471
+ utils.inherits(CanceledError, core_AxiosError, {
51472
+ __CANCEL__: true
51473
+ });
51474
+
51475
+ /* harmony default export */ const cancel_CanceledError = (CanceledError);
51476
+
51477
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/settle.js
51478
+
51479
+
51480
+
51481
+
51482
+ /**
51483
+ * Resolve or reject a Promise based on response status.
51484
+ *
51485
+ * @param {Function} resolve A function that resolves the promise.
51486
+ * @param {Function} reject A function that rejects the promise.
51487
+ * @param {object} response The response.
51488
+ *
51489
+ * @returns {object} The response.
51490
+ */
51491
+ function settle(resolve, reject, response) {
51492
+ const validateStatus = response.config.validateStatus;
51493
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
51494
+ resolve(response);
51495
+ } else {
51496
+ reject(new core_AxiosError(
51497
+ 'Request failed with status code ' + response.status,
51498
+ [core_AxiosError.ERR_BAD_REQUEST, core_AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
51499
+ response.config,
51500
+ response.request,
51501
+ response
51502
+ ));
51503
+ }
51504
+ }
51505
+
51506
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/cookies.js
51507
+
51508
+
51509
+
51510
+ /* harmony default export */ const cookies = (platform.hasStandardBrowserEnv ?
51511
+
51512
+ // Standard browser envs support document.cookie
51513
+ {
51514
+ write(name, value, expires, path, domain, secure) {
51515
+ const cookie = [name + '=' + encodeURIComponent(value)];
51516
+
51517
+ utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
51518
+
51519
+ utils.isString(path) && cookie.push('path=' + path);
51520
+
51521
+ utils.isString(domain) && cookie.push('domain=' + domain);
51522
+
51523
+ secure === true && cookie.push('secure');
51524
+
51525
+ document.cookie = cookie.join('; ');
51526
+ },
51527
+
51528
+ read(name) {
51529
+ const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
51530
+ return (match ? decodeURIComponent(match[3]) : null);
51531
+ },
51532
+
51533
+ remove(name) {
51534
+ this.write(name, '', Date.now() - 86400000);
51535
+ }
51536
+ }
51537
+
51538
+ :
51539
+
51540
+ // Non-standard browser env (web workers, react-native) lack needed support.
51541
+ {
51542
+ write() {},
51543
+ read() {
51544
+ return null;
51545
+ },
51546
+ remove() {}
51547
+ });
51548
+
51549
+
51550
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/isAbsoluteURL.js
51551
+
51552
+
51553
+ /**
51554
+ * Determines whether the specified URL is absolute
51555
+ *
51556
+ * @param {string} url The URL to test
51557
+ *
51558
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
51559
+ */
51560
+ function isAbsoluteURL(url) {
51561
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
51562
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
51563
+ // by any combination of letters, digits, plus, period, or hyphen.
51564
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
51565
+ }
51566
+
51567
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/combineURLs.js
51568
+
51569
+
51570
+ /**
51571
+ * Creates a new URL by combining the specified URLs
51572
+ *
51573
+ * @param {string} baseURL The base URL
51574
+ * @param {string} relativeURL The relative URL
51575
+ *
51576
+ * @returns {string} The combined URL
51577
+ */
51578
+ function combineURLs(baseURL, relativeURL) {
51579
+ return relativeURL
51580
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
51581
+ : baseURL;
51582
+ }
51583
+
51584
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/buildFullPath.js
51585
+
51586
+
51587
+
51588
+
51589
+
51590
+ /**
51591
+ * Creates a new URL by combining the baseURL with the requestedURL,
51592
+ * only when the requestedURL is not already an absolute URL.
51593
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
51594
+ *
51595
+ * @param {string} baseURL The base URL
51596
+ * @param {string} requestedURL Absolute or relative URL to combine
51597
+ *
51598
+ * @returns {string} The combined full path
51599
+ */
51600
+ function buildFullPath(baseURL, requestedURL) {
51601
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
51602
+ return combineURLs(baseURL, requestedURL);
51603
+ }
51604
+ return requestedURL;
51605
+ }
51606
+
51607
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/isURLSameOrigin.js
51608
+
51609
+
51610
+
51611
+
51612
+
51613
+ /* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ?
51614
+
51615
+ // Standard browser envs have full support of the APIs needed to test
51616
+ // whether the request URL is of the same origin as current location.
51617
+ (function standardBrowserEnv() {
51618
+ const msie = /(msie|trident)/i.test(navigator.userAgent);
51619
+ const urlParsingNode = document.createElement('a');
51620
+ let originURL;
51621
+
51622
+ /**
51623
+ * Parse a URL to discover its components
51624
+ *
51625
+ * @param {String} url The URL to be parsed
51626
+ * @returns {Object}
51627
+ */
51628
+ function resolveURL(url) {
51629
+ let href = url;
51630
+
51631
+ if (msie) {
51632
+ // IE needs attribute set twice to normalize properties
51633
+ urlParsingNode.setAttribute('href', href);
51634
+ href = urlParsingNode.href;
51635
+ }
51636
+
51637
+ urlParsingNode.setAttribute('href', href);
51638
+
51639
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
51640
+ return {
51641
+ href: urlParsingNode.href,
51642
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
51643
+ host: urlParsingNode.host,
51644
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
51645
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
51646
+ hostname: urlParsingNode.hostname,
51647
+ port: urlParsingNode.port,
51648
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
51649
+ urlParsingNode.pathname :
51650
+ '/' + urlParsingNode.pathname
51651
+ };
51652
+ }
51653
+
51654
+ originURL = resolveURL(window.location.href);
51655
+
51656
+ /**
51657
+ * Determine if a URL shares the same origin as the current location
51658
+ *
51659
+ * @param {String} requestURL The URL to test
51660
+ * @returns {boolean} True if URL shares the same origin, otherwise false
51661
+ */
51662
+ return function isURLSameOrigin(requestURL) {
51663
+ const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
51664
+ return (parsed.protocol === originURL.protocol &&
51665
+ parsed.host === originURL.host);
51666
+ };
51667
+ })() :
51668
+
51669
+ // Non standard browser envs (web workers, react-native) lack needed support.
51670
+ (function nonStandardBrowserEnv() {
51671
+ return function isURLSameOrigin() {
51672
+ return true;
51673
+ };
51674
+ })());
51675
+
51676
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/parseProtocol.js
51677
+
51678
+
51679
+ function parseProtocol(url) {
51680
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
51681
+ return match && match[1] || '';
51682
+ }
51683
+
51684
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/speedometer.js
51685
+
51686
+
51687
+ /**
51688
+ * Calculate data maxRate
51689
+ * @param {Number} [samplesCount= 10]
51690
+ * @param {Number} [min= 1000]
51691
+ * @returns {Function}
51692
+ */
51693
+ function speedometer(samplesCount, min) {
51694
+ samplesCount = samplesCount || 10;
51695
+ const bytes = new Array(samplesCount);
51696
+ const timestamps = new Array(samplesCount);
51697
+ let head = 0;
51698
+ let tail = 0;
51699
+ let firstSampleTS;
51700
+
51701
+ min = min !== undefined ? min : 1000;
51702
+
51703
+ return function push(chunkLength) {
51704
+ const now = Date.now();
51705
+
51706
+ const startedAt = timestamps[tail];
51707
+
51708
+ if (!firstSampleTS) {
51709
+ firstSampleTS = now;
51710
+ }
51711
+
51712
+ bytes[head] = chunkLength;
51713
+ timestamps[head] = now;
51714
+
51715
+ let i = tail;
51716
+ let bytesCount = 0;
51717
+
51718
+ while (i !== head) {
51719
+ bytesCount += bytes[i++];
51720
+ i = i % samplesCount;
51721
+ }
51722
+
51723
+ head = (head + 1) % samplesCount;
51724
+
51725
+ if (head === tail) {
51726
+ tail = (tail + 1) % samplesCount;
51727
+ }
51728
+
51729
+ if (now - firstSampleTS < min) {
51730
+ return;
51731
+ }
51732
+
51733
+ const passed = startedAt && now - startedAt;
51734
+
51735
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
51736
+ };
51737
+ }
51738
+
51739
+ /* harmony default export */ const helpers_speedometer = (speedometer);
51740
+
51741
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/adapters/xhr.js
51742
+
51743
+
51744
+
51745
+
51746
+
51747
+
51748
+
51749
+
51750
+
51751
+
51752
+
51753
+
51754
+
51755
+
51756
+
51757
+
51758
+ function progressEventReducer(listener, isDownloadStream) {
51759
+ let bytesNotified = 0;
51760
+ const _speedometer = helpers_speedometer(50, 250);
51761
+
51762
+ return e => {
51763
+ const loaded = e.loaded;
51764
+ const total = e.lengthComputable ? e.total : undefined;
51765
+ const progressBytes = loaded - bytesNotified;
51766
+ const rate = _speedometer(progressBytes);
51767
+ const inRange = loaded <= total;
51768
+
51769
+ bytesNotified = loaded;
51770
+
51771
+ const data = {
51772
+ loaded,
51773
+ total,
51774
+ progress: total ? (loaded / total) : undefined,
51775
+ bytes: progressBytes,
51776
+ rate: rate ? rate : undefined,
51777
+ estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
51778
+ event: e
51779
+ };
51780
+
51781
+ data[isDownloadStream ? 'download' : 'upload'] = true;
51782
+
51783
+ listener(data);
51784
+ };
51785
+ }
51786
+
51787
+ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
51788
+
51789
+ /* harmony default export */ const xhr = (isXHRAdapterSupported && function (config) {
51790
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
51791
+ let requestData = config.data;
51792
+ const requestHeaders = core_AxiosHeaders.from(config.headers).normalize();
51793
+ let {responseType, withXSRFToken} = config;
51794
+ let onCanceled;
51795
+ function done() {
51796
+ if (config.cancelToken) {
51797
+ config.cancelToken.unsubscribe(onCanceled);
51798
+ }
51799
+
51800
+ if (config.signal) {
51801
+ config.signal.removeEventListener('abort', onCanceled);
51802
+ }
51803
+ }
51804
+
51805
+ let contentType;
51806
+
51807
+ if (utils.isFormData(requestData)) {
51808
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
51809
+ requestHeaders.setContentType(false); // Let the browser set it
51810
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
51811
+ // fix semicolon duplication issue for ReactNative FormData implementation
51812
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
51813
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
51814
+ }
51815
+ }
51816
+
51817
+ let request = new XMLHttpRequest();
51818
+
51819
+ // HTTP basic authentication
51820
+ if (config.auth) {
51821
+ const username = config.auth.username || '';
51822
+ const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
51823
+ requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
51824
+ }
51825
+
51826
+ const fullPath = buildFullPath(config.baseURL, config.url);
51827
+
51828
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
51829
+
51830
+ // Set the request timeout in MS
51831
+ request.timeout = config.timeout;
51832
+
51833
+ function onloadend() {
51834
+ if (!request) {
51835
+ return;
51836
+ }
51837
+ // Prepare the response
51838
+ const responseHeaders = core_AxiosHeaders.from(
51839
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
51840
+ );
51841
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
51842
+ request.responseText : request.response;
51843
+ const response = {
51844
+ data: responseData,
51845
+ status: request.status,
51846
+ statusText: request.statusText,
51847
+ headers: responseHeaders,
51848
+ config,
51849
+ request
51850
+ };
51851
+
51852
+ settle(function _resolve(value) {
51853
+ resolve(value);
51854
+ done();
51855
+ }, function _reject(err) {
51856
+ reject(err);
51857
+ done();
51858
+ }, response);
51859
+
51860
+ // Clean up request
51861
+ request = null;
51862
+ }
51863
+
51864
+ if ('onloadend' in request) {
51865
+ // Use onloadend if available
51866
+ request.onloadend = onloadend;
51867
+ } else {
51868
+ // Listen for ready state to emulate onloadend
51869
+ request.onreadystatechange = function handleLoad() {
51870
+ if (!request || request.readyState !== 4) {
51871
+ return;
51872
+ }
51873
+
51874
+ // The request errored out and we didn't get a response, this will be
51875
+ // handled by onerror instead
51876
+ // With one exception: request that using file: protocol, most browsers
51877
+ // will return status as 0 even though it's a successful request
51878
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
51879
+ return;
51880
+ }
51881
+ // readystate handler is calling before onerror or ontimeout handlers,
51882
+ // so we should call onloadend on the next 'tick'
51883
+ setTimeout(onloadend);
51884
+ };
51885
+ }
51886
+
51887
+ // Handle browser request cancellation (as opposed to a manual cancellation)
51888
+ request.onabort = function handleAbort() {
51889
+ if (!request) {
51890
+ return;
51891
+ }
51892
+
51893
+ reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request));
51894
+
51895
+ // Clean up request
51896
+ request = null;
51897
+ };
51898
+
51899
+ // Handle low level network errors
51900
+ request.onerror = function handleError() {
51901
+ // Real errors are hidden from us by the browser
51902
+ // onerror should only fire if it's a network error
51903
+ reject(new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request));
51904
+
51905
+ // Clean up request
51906
+ request = null;
51907
+ };
51908
+
51909
+ // Handle timeout
51910
+ request.ontimeout = function handleTimeout() {
51911
+ let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
51912
+ const transitional = config.transitional || defaults_transitional;
51913
+ if (config.timeoutErrorMessage) {
51914
+ timeoutErrorMessage = config.timeoutErrorMessage;
51915
+ }
51916
+ reject(new core_AxiosError(
51917
+ timeoutErrorMessage,
51918
+ transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED,
51919
+ config,
51920
+ request));
51921
+
51922
+ // Clean up request
51923
+ request = null;
51924
+ };
51925
+
51926
+ // Add xsrf header
51927
+ // This is only done if running in a standard browser environment.
51928
+ // Specifically not if we're in a web worker, or react-native.
51929
+ if(platform.hasStandardBrowserEnv) {
51930
+ withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
51931
+
51932
+ if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
51933
+ // Add xsrf header
51934
+ const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
51935
+
51936
+ if (xsrfValue) {
51937
+ requestHeaders.set(config.xsrfHeaderName, xsrfValue);
51938
+ }
51939
+ }
51940
+ }
51941
+
51942
+ // Remove Content-Type if data is undefined
51943
+ requestData === undefined && requestHeaders.setContentType(null);
51944
+
51945
+ // Add headers to the request
51946
+ if ('setRequestHeader' in request) {
51947
+ utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
51948
+ request.setRequestHeader(key, val);
51949
+ });
51950
+ }
51951
+
51952
+ // Add withCredentials to request if needed
51953
+ if (!utils.isUndefined(config.withCredentials)) {
51954
+ request.withCredentials = !!config.withCredentials;
51955
+ }
51956
+
51957
+ // Add responseType to request if needed
51958
+ if (responseType && responseType !== 'json') {
51959
+ request.responseType = config.responseType;
51960
+ }
51961
+
51962
+ // Handle progress if needed
51963
+ if (typeof config.onDownloadProgress === 'function') {
51964
+ request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
51965
+ }
51966
+
51967
+ // Not all browsers support upload events
51968
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
51969
+ request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
51970
+ }
51971
+
51972
+ if (config.cancelToken || config.signal) {
51973
+ // Handle cancellation
51974
+ // eslint-disable-next-line func-names
51975
+ onCanceled = cancel => {
51976
+ if (!request) {
51977
+ return;
51978
+ }
51979
+ reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel);
51980
+ request.abort();
51981
+ request = null;
51982
+ };
51983
+
51984
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
51985
+ if (config.signal) {
51986
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
51987
+ }
51988
+ }
51989
+
51990
+ const protocol = parseProtocol(fullPath);
51991
+
51992
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
51993
+ reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config));
51994
+ return;
51995
+ }
51996
+
51997
+
51998
+ // Send the request
51999
+ request.send(requestData || null);
52000
+ });
52001
+ });
52002
+
52003
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/adapters/adapters.js
52004
+
52005
+
52006
+
52007
+
52008
+
52009
+ const knownAdapters = {
52010
+ http: helpers_null,
52011
+ xhr: xhr
52012
+ }
52013
+
52014
+ utils.forEach(knownAdapters, (fn, value) => {
52015
+ if (fn) {
52016
+ try {
52017
+ Object.defineProperty(fn, 'name', {value});
52018
+ } catch (e) {
52019
+ // eslint-disable-next-line no-empty
52020
+ }
52021
+ Object.defineProperty(fn, 'adapterName', {value});
52022
+ }
52023
+ });
52024
+
52025
+ const renderReason = (reason) => `- ${reason}`;
52026
+
52027
+ const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
52028
+
52029
+ /* harmony default export */ const adapters = ({
52030
+ getAdapter: (adapters) => {
52031
+ adapters = utils.isArray(adapters) ? adapters : [adapters];
52032
+
52033
+ const {length} = adapters;
52034
+ let nameOrAdapter;
52035
+ let adapter;
52036
+
52037
+ const rejectedReasons = {};
52038
+
52039
+ for (let i = 0; i < length; i++) {
52040
+ nameOrAdapter = adapters[i];
52041
+ let id;
52042
+
52043
+ adapter = nameOrAdapter;
52044
+
52045
+ if (!isResolvedHandle(nameOrAdapter)) {
52046
+ adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
52047
+
52048
+ if (adapter === undefined) {
52049
+ throw new core_AxiosError(`Unknown adapter '${id}'`);
52050
+ }
52051
+ }
52052
+
52053
+ if (adapter) {
52054
+ break;
52055
+ }
52056
+
52057
+ rejectedReasons[id || '#' + i] = adapter;
52058
+ }
52059
+
52060
+ if (!adapter) {
52061
+
52062
+ const reasons = Object.entries(rejectedReasons)
52063
+ .map(([id, state]) => `adapter ${id} ` +
52064
+ (state === false ? 'is not supported by the environment' : 'is not available in the build')
52065
+ );
52066
+
52067
+ let s = length ?
52068
+ (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
52069
+ 'as no adapter specified';
52070
+
52071
+ throw new core_AxiosError(
52072
+ `There is no suitable adapter to dispatch the request ` + s,
52073
+ 'ERR_NOT_SUPPORT'
52074
+ );
52075
+ }
52076
+
52077
+ return adapter;
52078
+ },
52079
+ adapters: knownAdapters
52080
+ });
52081
+
52082
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/dispatchRequest.js
52083
+
52084
+
52085
+
52086
+
52087
+
52088
+
52089
+
52090
+
52091
+
52092
+ /**
52093
+ * Throws a `CanceledError` if cancellation has been requested.
52094
+ *
52095
+ * @param {Object} config The config that is to be used for the request
52096
+ *
52097
+ * @returns {void}
52098
+ */
52099
+ function throwIfCancellationRequested(config) {
52100
+ if (config.cancelToken) {
52101
+ config.cancelToken.throwIfRequested();
52102
+ }
52103
+
52104
+ if (config.signal && config.signal.aborted) {
52105
+ throw new cancel_CanceledError(null, config);
52106
+ }
52107
+ }
52108
+
52109
+ /**
52110
+ * Dispatch a request to the server using the configured adapter.
52111
+ *
52112
+ * @param {object} config The config that is to be used for the request
52113
+ *
52114
+ * @returns {Promise} The Promise to be fulfilled
52115
+ */
52116
+ function dispatchRequest(config) {
52117
+ throwIfCancellationRequested(config);
52118
+
52119
+ config.headers = core_AxiosHeaders.from(config.headers);
52120
+
52121
+ // Transform request data
52122
+ config.data = transformData.call(
52123
+ config,
52124
+ config.transformRequest
52125
+ );
52126
+
52127
+ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
52128
+ config.headers.setContentType('application/x-www-form-urlencoded', false);
52129
+ }
52130
+
52131
+ const adapter = adapters.getAdapter(config.adapter || lib_defaults.adapter);
52132
+
52133
+ return adapter(config).then(function onAdapterResolution(response) {
52134
+ throwIfCancellationRequested(config);
52135
+
52136
+ // Transform response data
52137
+ response.data = transformData.call(
52138
+ config,
52139
+ config.transformResponse,
52140
+ response
52141
+ );
52142
+
52143
+ response.headers = core_AxiosHeaders.from(response.headers);
52144
+
52145
+ return response;
52146
+ }, function onAdapterRejection(reason) {
52147
+ if (!isCancel(reason)) {
52148
+ throwIfCancellationRequested(config);
52149
+
52150
+ // Transform response data
52151
+ if (reason && reason.response) {
52152
+ reason.response.data = transformData.call(
52153
+ config,
52154
+ config.transformResponse,
52155
+ reason.response
52156
+ );
52157
+ reason.response.headers = core_AxiosHeaders.from(reason.response.headers);
52158
+ }
52159
+ }
52160
+
52161
+ return Promise.reject(reason);
52162
+ });
52163
+ }
52164
+
52165
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/mergeConfig.js
52166
+
52167
+
52168
+
52169
+
52170
+
52171
+ const headersToObject = (thing) => thing instanceof core_AxiosHeaders ? thing.toJSON() : thing;
52172
+
52173
+ /**
52174
+ * Config-specific merge-function which creates a new config-object
52175
+ * by merging two configuration objects together.
52176
+ *
52177
+ * @param {Object} config1
52178
+ * @param {Object} config2
52179
+ *
52180
+ * @returns {Object} New object resulting from merging config2 to config1
52181
+ */
52182
+ function mergeConfig(config1, config2) {
52183
+ // eslint-disable-next-line no-param-reassign
52184
+ config2 = config2 || {};
52185
+ const config = {};
52186
+
52187
+ function getMergedValue(target, source, caseless) {
52188
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
52189
+ return utils.merge.call({caseless}, target, source);
52190
+ } else if (utils.isPlainObject(source)) {
52191
+ return utils.merge({}, source);
52192
+ } else if (utils.isArray(source)) {
52193
+ return source.slice();
52194
+ }
52195
+ return source;
52196
+ }
52197
+
52198
+ // eslint-disable-next-line consistent-return
52199
+ function mergeDeepProperties(a, b, caseless) {
52200
+ if (!utils.isUndefined(b)) {
52201
+ return getMergedValue(a, b, caseless);
52202
+ } else if (!utils.isUndefined(a)) {
52203
+ return getMergedValue(undefined, a, caseless);
52204
+ }
52205
+ }
52206
+
52207
+ // eslint-disable-next-line consistent-return
52208
+ function valueFromConfig2(a, b) {
52209
+ if (!utils.isUndefined(b)) {
52210
+ return getMergedValue(undefined, b);
52211
+ }
52212
+ }
52213
+
52214
+ // eslint-disable-next-line consistent-return
52215
+ function defaultToConfig2(a, b) {
52216
+ if (!utils.isUndefined(b)) {
52217
+ return getMergedValue(undefined, b);
52218
+ } else if (!utils.isUndefined(a)) {
52219
+ return getMergedValue(undefined, a);
52220
+ }
52221
+ }
52222
+
52223
+ // eslint-disable-next-line consistent-return
52224
+ function mergeDirectKeys(a, b, prop) {
52225
+ if (prop in config2) {
52226
+ return getMergedValue(a, b);
52227
+ } else if (prop in config1) {
52228
+ return getMergedValue(undefined, a);
52229
+ }
52230
+ }
52231
+
52232
+ const mergeMap = {
52233
+ url: valueFromConfig2,
52234
+ method: valueFromConfig2,
52235
+ data: valueFromConfig2,
52236
+ baseURL: defaultToConfig2,
52237
+ transformRequest: defaultToConfig2,
52238
+ transformResponse: defaultToConfig2,
52239
+ paramsSerializer: defaultToConfig2,
52240
+ timeout: defaultToConfig2,
52241
+ timeoutMessage: defaultToConfig2,
52242
+ withCredentials: defaultToConfig2,
52243
+ withXSRFToken: defaultToConfig2,
52244
+ adapter: defaultToConfig2,
52245
+ responseType: defaultToConfig2,
52246
+ xsrfCookieName: defaultToConfig2,
52247
+ xsrfHeaderName: defaultToConfig2,
52248
+ onUploadProgress: defaultToConfig2,
52249
+ onDownloadProgress: defaultToConfig2,
52250
+ decompress: defaultToConfig2,
52251
+ maxContentLength: defaultToConfig2,
52252
+ maxBodyLength: defaultToConfig2,
52253
+ beforeRedirect: defaultToConfig2,
52254
+ transport: defaultToConfig2,
52255
+ httpAgent: defaultToConfig2,
52256
+ httpsAgent: defaultToConfig2,
52257
+ cancelToken: defaultToConfig2,
52258
+ socketPath: defaultToConfig2,
52259
+ responseEncoding: defaultToConfig2,
52260
+ validateStatus: mergeDirectKeys,
52261
+ headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
52262
+ };
52263
+
52264
+ utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
52265
+ const merge = mergeMap[prop] || mergeDeepProperties;
52266
+ const configValue = merge(config1[prop], config2[prop], prop);
52267
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
52268
+ });
52269
+
52270
+ return config;
52271
+ }
52272
+
52273
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/env/data.js
52274
+ const VERSION = "1.6.2";
52275
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/validator.js
52276
+
52277
+
52278
+
52279
+
52280
+
52281
+ const validators = {};
52282
+
52283
+ // eslint-disable-next-line func-names
52284
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
52285
+ validators[type] = function validator(thing) {
52286
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
52287
+ };
52288
+ });
52289
+
52290
+ const deprecatedWarnings = {};
52291
+
52292
+ /**
52293
+ * Transitional option validator
52294
+ *
52295
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
52296
+ * @param {string?} version - deprecated version / removed since version
52297
+ * @param {string?} message - some message with additional info
52298
+ *
52299
+ * @returns {function}
52300
+ */
52301
+ validators.transitional = function transitional(validator, version, message) {
52302
+ function formatMessage(opt, desc) {
52303
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
52304
+ }
52305
+
52306
+ // eslint-disable-next-line func-names
52307
+ return (value, opt, opts) => {
52308
+ if (validator === false) {
52309
+ throw new core_AxiosError(
52310
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
52311
+ core_AxiosError.ERR_DEPRECATED
52312
+ );
52313
+ }
52314
+
52315
+ if (version && !deprecatedWarnings[opt]) {
52316
+ deprecatedWarnings[opt] = true;
52317
+ // eslint-disable-next-line no-console
52318
+ console.warn(
52319
+ formatMessage(
52320
+ opt,
52321
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
52322
+ )
52323
+ );
52324
+ }
52325
+
52326
+ return validator ? validator(value, opt, opts) : true;
52327
+ };
52328
+ };
52329
+
52330
+ /**
52331
+ * Assert object's properties type
52332
+ *
52333
+ * @param {object} options
52334
+ * @param {object} schema
52335
+ * @param {boolean?} allowUnknown
52336
+ *
52337
+ * @returns {object}
52338
+ */
52339
+
52340
+ function assertOptions(options, schema, allowUnknown) {
52341
+ if (typeof options !== 'object') {
52342
+ throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE);
52343
+ }
52344
+ const keys = Object.keys(options);
52345
+ let i = keys.length;
52346
+ while (i-- > 0) {
52347
+ const opt = keys[i];
52348
+ const validator = schema[opt];
52349
+ if (validator) {
52350
+ const value = options[opt];
52351
+ const result = value === undefined || validator(value, opt, options);
52352
+ if (result !== true) {
52353
+ throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE);
52354
+ }
52355
+ continue;
52356
+ }
52357
+ if (allowUnknown !== true) {
52358
+ throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION);
52359
+ }
52360
+ }
52361
+ }
52362
+
52363
+ /* harmony default export */ const validator = ({
52364
+ assertOptions,
52365
+ validators
52366
+ });
52367
+
52368
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/core/Axios.js
52369
+
52370
+
52371
+
52372
+
52373
+
52374
+
52375
+
52376
+
52377
+
52378
+
52379
+
52380
+ const Axios_validators = validator.validators;
52381
+
52382
+ /**
52383
+ * Create a new instance of Axios
52384
+ *
52385
+ * @param {Object} instanceConfig The default config for the instance
52386
+ *
52387
+ * @return {Axios} A new instance of Axios
52388
+ */
52389
+ class Axios {
52390
+ constructor(instanceConfig) {
52391
+ this.defaults = instanceConfig;
52392
+ this.interceptors = {
52393
+ request: new core_InterceptorManager(),
52394
+ response: new core_InterceptorManager()
52395
+ };
52396
+ }
52397
+
52398
+ /**
52399
+ * Dispatch a request
52400
+ *
52401
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
52402
+ * @param {?Object} config
52403
+ *
52404
+ * @returns {Promise} The Promise to be fulfilled
52405
+ */
52406
+ request(configOrUrl, config) {
52407
+ /*eslint no-param-reassign:0*/
52408
+ // Allow for axios('example/url'[, config]) a la fetch API
52409
+ if (typeof configOrUrl === 'string') {
52410
+ config = config || {};
52411
+ config.url = configOrUrl;
52412
+ } else {
52413
+ config = configOrUrl || {};
52414
+ }
52415
+
52416
+ config = mergeConfig(this.defaults, config);
52417
+
52418
+ const {transitional, paramsSerializer, headers} = config;
52419
+
52420
+ if (transitional !== undefined) {
52421
+ validator.assertOptions(transitional, {
52422
+ silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean),
52423
+ forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean),
52424
+ clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean)
52425
+ }, false);
52426
+ }
52427
+
52428
+ if (paramsSerializer != null) {
52429
+ if (utils.isFunction(paramsSerializer)) {
52430
+ config.paramsSerializer = {
52431
+ serialize: paramsSerializer
52432
+ }
52433
+ } else {
52434
+ validator.assertOptions(paramsSerializer, {
52435
+ encode: Axios_validators.function,
52436
+ serialize: Axios_validators.function
52437
+ }, true);
52438
+ }
52439
+ }
52440
+
52441
+ // Set config.method
52442
+ config.method = (config.method || this.defaults.method || 'get').toLowerCase();
52443
+
52444
+ // Flatten headers
52445
+ let contextHeaders = headers && utils.merge(
52446
+ headers.common,
52447
+ headers[config.method]
52448
+ );
52449
+
52450
+ headers && utils.forEach(
52451
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
52452
+ (method) => {
52453
+ delete headers[method];
52454
+ }
52455
+ );
52456
+
52457
+ config.headers = core_AxiosHeaders.concat(contextHeaders, headers);
52458
+
52459
+ // filter out skipped interceptors
52460
+ const requestInterceptorChain = [];
52461
+ let synchronousRequestInterceptors = true;
52462
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
52463
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
52464
+ return;
52465
+ }
52466
+
52467
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
52468
+
52469
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
52470
+ });
52471
+
52472
+ const responseInterceptorChain = [];
52473
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
52474
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
52475
+ });
52476
+
52477
+ let promise;
52478
+ let i = 0;
52479
+ let len;
52480
+
52481
+ if (!synchronousRequestInterceptors) {
52482
+ const chain = [dispatchRequest.bind(this), undefined];
52483
+ chain.unshift.apply(chain, requestInterceptorChain);
52484
+ chain.push.apply(chain, responseInterceptorChain);
52485
+ len = chain.length;
52486
+
52487
+ promise = Promise.resolve(config);
52488
+
52489
+ while (i < len) {
52490
+ promise = promise.then(chain[i++], chain[i++]);
52491
+ }
52492
+
52493
+ return promise;
52494
+ }
52495
+
52496
+ len = requestInterceptorChain.length;
52497
+
52498
+ let newConfig = config;
52499
+
52500
+ i = 0;
52501
+
52502
+ while (i < len) {
52503
+ const onFulfilled = requestInterceptorChain[i++];
52504
+ const onRejected = requestInterceptorChain[i++];
52505
+ try {
52506
+ newConfig = onFulfilled(newConfig);
52507
+ } catch (error) {
52508
+ onRejected.call(this, error);
52509
+ break;
52510
+ }
52511
+ }
52512
+
52513
+ try {
52514
+ promise = dispatchRequest.call(this, newConfig);
52515
+ } catch (error) {
52516
+ return Promise.reject(error);
52517
+ }
52518
+
52519
+ i = 0;
52520
+ len = responseInterceptorChain.length;
52521
+
52522
+ while (i < len) {
52523
+ promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
52524
+ }
52525
+
52526
+ return promise;
52527
+ }
52528
+
52529
+ getUri(config) {
52530
+ config = mergeConfig(this.defaults, config);
52531
+ const fullPath = buildFullPath(config.baseURL, config.url);
52532
+ return buildURL(fullPath, config.params, config.paramsSerializer);
52533
+ }
52534
+ }
52535
+
52536
+ // Provide aliases for supported request methods
52537
+ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
52538
+ /*eslint func-names:0*/
52539
+ Axios.prototype[method] = function(url, config) {
52540
+ return this.request(mergeConfig(config || {}, {
52541
+ method,
52542
+ url,
52543
+ data: (config || {}).data
52544
+ }));
52545
+ };
52546
+ });
52547
+
52548
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
52549
+ /*eslint func-names:0*/
52550
+
52551
+ function generateHTTPMethod(isForm) {
52552
+ return function httpMethod(url, data, config) {
52553
+ return this.request(mergeConfig(config || {}, {
52554
+ method,
52555
+ headers: isForm ? {
52556
+ 'Content-Type': 'multipart/form-data'
52557
+ } : {},
52558
+ url,
52559
+ data
52560
+ }));
52561
+ };
52562
+ }
52563
+
52564
+ Axios.prototype[method] = generateHTTPMethod();
52565
+
52566
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
52567
+ });
52568
+
52569
+ /* harmony default export */ const core_Axios = (Axios);
52570
+
52571
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/cancel/CancelToken.js
52572
+
52573
+
52574
+
52575
+
52576
+ /**
52577
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
52578
+ *
52579
+ * @param {Function} executor The executor function.
52580
+ *
52581
+ * @returns {CancelToken}
52582
+ */
52583
+ class CancelToken {
52584
+ constructor(executor) {
52585
+ if (typeof executor !== 'function') {
52586
+ throw new TypeError('executor must be a function.');
52587
+ }
52588
+
52589
+ let resolvePromise;
52590
+
52591
+ this.promise = new Promise(function promiseExecutor(resolve) {
52592
+ resolvePromise = resolve;
52593
+ });
52594
+
52595
+ const token = this;
52596
+
52597
+ // eslint-disable-next-line func-names
52598
+ this.promise.then(cancel => {
52599
+ if (!token._listeners) return;
52600
+
52601
+ let i = token._listeners.length;
52602
+
52603
+ while (i-- > 0) {
52604
+ token._listeners[i](cancel);
52605
+ }
52606
+ token._listeners = null;
52607
+ });
52608
+
52609
+ // eslint-disable-next-line func-names
52610
+ this.promise.then = onfulfilled => {
52611
+ let _resolve;
52612
+ // eslint-disable-next-line func-names
52613
+ const promise = new Promise(resolve => {
52614
+ token.subscribe(resolve);
52615
+ _resolve = resolve;
52616
+ }).then(onfulfilled);
52617
+
52618
+ promise.cancel = function reject() {
52619
+ token.unsubscribe(_resolve);
52620
+ };
52621
+
52622
+ return promise;
52623
+ };
52624
+
52625
+ executor(function cancel(message, config, request) {
52626
+ if (token.reason) {
52627
+ // Cancellation has already been requested
52628
+ return;
52629
+ }
52630
+
52631
+ token.reason = new cancel_CanceledError(message, config, request);
52632
+ resolvePromise(token.reason);
52633
+ });
52634
+ }
52635
+
52636
+ /**
52637
+ * Throws a `CanceledError` if cancellation has been requested.
52638
+ */
52639
+ throwIfRequested() {
52640
+ if (this.reason) {
52641
+ throw this.reason;
52642
+ }
52643
+ }
52644
+
52645
+ /**
52646
+ * Subscribe to the cancel signal
52647
+ */
52648
+
52649
+ subscribe(listener) {
52650
+ if (this.reason) {
52651
+ listener(this.reason);
52652
+ return;
52653
+ }
52654
+
52655
+ if (this._listeners) {
52656
+ this._listeners.push(listener);
52657
+ } else {
52658
+ this._listeners = [listener];
52659
+ }
52660
+ }
52661
+
52662
+ /**
52663
+ * Unsubscribe from the cancel signal
52664
+ */
52665
+
52666
+ unsubscribe(listener) {
52667
+ if (!this._listeners) {
52668
+ return;
52669
+ }
52670
+ const index = this._listeners.indexOf(listener);
52671
+ if (index !== -1) {
52672
+ this._listeners.splice(index, 1);
52673
+ }
52674
+ }
52675
+
52676
+ /**
52677
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
52678
+ * cancels the `CancelToken`.
52679
+ */
52680
+ static source() {
52681
+ let cancel;
52682
+ const token = new CancelToken(function executor(c) {
52683
+ cancel = c;
52684
+ });
52685
+ return {
52686
+ token,
52687
+ cancel
52688
+ };
52689
+ }
52690
+ }
52691
+
52692
+ /* harmony default export */ const cancel_CancelToken = (CancelToken);
52693
+
52694
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/spread.js
52695
+
52696
+
52697
+ /**
52698
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
52699
+ *
52700
+ * Common use case would be to use `Function.prototype.apply`.
52701
+ *
52702
+ * ```js
52703
+ * function f(x, y, z) {}
52704
+ * var args = [1, 2, 3];
52705
+ * f.apply(null, args);
52706
+ * ```
52707
+ *
52708
+ * With `spread` this example can be re-written.
52709
+ *
52710
+ * ```js
52711
+ * spread(function(x, y, z) {})([1, 2, 3]);
52712
+ * ```
52713
+ *
52714
+ * @param {Function} callback
52715
+ *
52716
+ * @returns {Function}
52717
+ */
52718
+ function spread(callback) {
52719
+ return function wrap(arr) {
52720
+ return callback.apply(null, arr);
52721
+ };
52722
+ }
52723
+
52724
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/isAxiosError.js
52725
+
52726
+
52727
+
52728
+
52729
+ /**
52730
+ * Determines whether the payload is an error thrown by Axios
52731
+ *
52732
+ * @param {*} payload The value to test
52733
+ *
52734
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
52735
+ */
52736
+ function isAxiosError(payload) {
52737
+ return utils.isObject(payload) && (payload.isAxiosError === true);
52738
+ }
52739
+
52740
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/helpers/HttpStatusCode.js
52741
+ const HttpStatusCode = {
52742
+ Continue: 100,
52743
+ SwitchingProtocols: 101,
52744
+ Processing: 102,
52745
+ EarlyHints: 103,
52746
+ Ok: 200,
52747
+ Created: 201,
52748
+ Accepted: 202,
52749
+ NonAuthoritativeInformation: 203,
52750
+ NoContent: 204,
52751
+ ResetContent: 205,
52752
+ PartialContent: 206,
52753
+ MultiStatus: 207,
52754
+ AlreadyReported: 208,
52755
+ ImUsed: 226,
52756
+ MultipleChoices: 300,
52757
+ MovedPermanently: 301,
52758
+ Found: 302,
52759
+ SeeOther: 303,
52760
+ NotModified: 304,
52761
+ UseProxy: 305,
52762
+ Unused: 306,
52763
+ TemporaryRedirect: 307,
52764
+ PermanentRedirect: 308,
52765
+ BadRequest: 400,
52766
+ Unauthorized: 401,
52767
+ PaymentRequired: 402,
52768
+ Forbidden: 403,
52769
+ NotFound: 404,
52770
+ MethodNotAllowed: 405,
52771
+ NotAcceptable: 406,
52772
+ ProxyAuthenticationRequired: 407,
52773
+ RequestTimeout: 408,
52774
+ Conflict: 409,
52775
+ Gone: 410,
52776
+ LengthRequired: 411,
52777
+ PreconditionFailed: 412,
52778
+ PayloadTooLarge: 413,
52779
+ UriTooLong: 414,
52780
+ UnsupportedMediaType: 415,
52781
+ RangeNotSatisfiable: 416,
52782
+ ExpectationFailed: 417,
52783
+ ImATeapot: 418,
52784
+ MisdirectedRequest: 421,
52785
+ UnprocessableEntity: 422,
52786
+ Locked: 423,
52787
+ FailedDependency: 424,
52788
+ TooEarly: 425,
52789
+ UpgradeRequired: 426,
52790
+ PreconditionRequired: 428,
52791
+ TooManyRequests: 429,
52792
+ RequestHeaderFieldsTooLarge: 431,
52793
+ UnavailableForLegalReasons: 451,
52794
+ InternalServerError: 500,
52795
+ NotImplemented: 501,
52796
+ BadGateway: 502,
52797
+ ServiceUnavailable: 503,
52798
+ GatewayTimeout: 504,
52799
+ HttpVersionNotSupported: 505,
52800
+ VariantAlsoNegotiates: 506,
52801
+ InsufficientStorage: 507,
52802
+ LoopDetected: 508,
52803
+ NotExtended: 510,
52804
+ NetworkAuthenticationRequired: 511,
52805
+ };
52806
+
52807
+ Object.entries(HttpStatusCode).forEach(([key, value]) => {
52808
+ HttpStatusCode[value] = key;
52809
+ });
52810
+
52811
+ /* harmony default export */ const helpers_HttpStatusCode = (HttpStatusCode);
52812
+
52813
+ ;// CONCATENATED MODULE: ../node_modules/axios/lib/axios.js
52814
+
52815
+
52816
+
52817
+
52818
+
52819
+
52820
+
52821
+
52822
+
52823
+
52824
+
52825
+
52826
+
52827
+
52828
+
52829
+
52830
+
52831
+
52832
+
52833
+
52834
+ /**
52835
+ * Create an instance of Axios
52836
+ *
52837
+ * @param {Object} defaultConfig The default config for the instance
52838
+ *
52839
+ * @returns {Axios} A new instance of Axios
52840
+ */
52841
+ function createInstance(defaultConfig) {
52842
+ const context = new core_Axios(defaultConfig);
52843
+ const instance = bind_bind(core_Axios.prototype.request, context);
52844
+
52845
+ // Copy axios.prototype to instance
52846
+ utils.extend(instance, core_Axios.prototype, context, {allOwnKeys: true});
52847
+
52848
+ // Copy context to instance
52849
+ utils.extend(instance, context, null, {allOwnKeys: true});
52850
+
52851
+ // Factory for creating new instances
52852
+ instance.create = function create(instanceConfig) {
52853
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
52854
+ };
52855
+
52856
+ return instance;
52857
+ }
52858
+
52859
+ // Create the default instance to be exported
52860
+ const axios = createInstance(lib_defaults);
52861
+
52862
+ // Expose Axios class to allow class inheritance
52863
+ axios.Axios = core_Axios;
52864
+
52865
+ // Expose Cancel & CancelToken
52866
+ axios.CanceledError = cancel_CanceledError;
52867
+ axios.CancelToken = cancel_CancelToken;
52868
+ axios.isCancel = isCancel;
52869
+ axios.VERSION = VERSION;
52870
+ axios.toFormData = helpers_toFormData;
52871
+
52872
+ // Expose AxiosError class
52873
+ axios.AxiosError = core_AxiosError;
52874
+
52875
+ // alias for CanceledError for backward compatibility
52876
+ axios.Cancel = axios.CanceledError;
52877
+
52878
+ // Expose all/spread
52879
+ axios.all = function all(promises) {
52880
+ return Promise.all(promises);
52881
+ };
52882
+
52883
+ axios.spread = spread;
52884
+
52885
+ // Expose isAxiosError
52886
+ axios.isAxiosError = isAxiosError;
52887
+
52888
+ // Expose mergeConfig
52889
+ axios.mergeConfig = mergeConfig;
52890
+
52891
+ axios.AxiosHeaders = core_AxiosHeaders;
52892
+
52893
+ axios.formToJSON = thing => helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
52894
+
52895
+ axios.getAdapter = adapters.getAdapter;
52896
+
52897
+ axios.HttpStatusCode = helpers_HttpStatusCode;
52898
+
52899
+ axios.default = axios;
52900
+
52901
+ // this module should only have a default export
52902
+ /* harmony default export */ const lib_axios = (axios);
52903
+
52904
+ ;// CONCATENATED MODULE: ../node_modules/axios/index.js
52905
+
52906
+
52907
+ // This module is intended to unwrap Axios default export as named.
52908
+ // Keep top-level export same with static properties
52909
+ // so that it can keep same with es module or cjs
52910
+ const {
52911
+ Axios: axios_Axios,
52912
+ AxiosError: axios_AxiosError,
52913
+ CanceledError: axios_CanceledError,
52914
+ isCancel: axios_isCancel,
52915
+ CancelToken: axios_CancelToken,
52916
+ VERSION: axios_VERSION,
52917
+ all: axios_all,
52918
+ Cancel,
52919
+ isAxiosError: axios_isAxiosError,
52920
+ spread: axios_spread,
52921
+ toFormData: axios_toFormData,
52922
+ AxiosHeaders: axios_AxiosHeaders,
52923
+ HttpStatusCode: axios_HttpStatusCode,
52924
+ formToJSON,
52925
+ getAdapter,
52926
+ mergeConfig: axios_mergeConfig
52927
+ } = lib_axios;
52928
+
52929
+
52930
+
49024
52931
  ;// CONCATENATED MODULE: ./src/rpc.manager.ts
49025
52932
 
49026
52933
 
@@ -49083,7 +52990,7 @@ class RpcManager {
49083
52990
  getStaticHeaders() {
49084
52991
  return this.staticHeaders;
49085
52992
  }
49086
- async post(path, message, files = []) {
52993
+ async post(path, message, files = [], filesFieldName = 'files') {
49087
52994
  this.onGoingRpcCounter.next(this.onGoingRpcCounter.value + 1);
49088
52995
  try {
49089
52996
  await this.getRateLimiterBucket(path).consume();
@@ -49095,57 +53002,64 @@ class RpcManager {
49095
53002
  headers = Object.assign(Object.assign({}, headers), authHeaders);
49096
53003
  DebugLogger.debug(`sending request: path: ${path} message: ${JSON.stringify(message)}`);
49097
53004
  const url = getApplicationUrl(this.region, this.appId, path);
49098
- let response;
49099
- if (files.length) {
49100
- const formData = new FormData();
49101
- files.forEach(file => {
49102
- formData.append('files', file);
49103
- });
49104
- formData.append('body', serialization_serializeObj(message));
49105
- // Make the fetch call
49106
- response = await external_cross_fetch_default()(url, {
49107
- method: 'POST',
49108
- body: formData,
49109
- headers,
49110
- });
53005
+ let axiosResponse;
53006
+ try {
53007
+ if (files.length) {
53008
+ const formData = new FormData();
53009
+ files.forEach(file => {
53010
+ const blob = file instanceof Blob ? file : file.blob;
53011
+ const filename = file instanceof Blob ? undefined : file.name;
53012
+ formData.append(filesFieldName, blob, filename);
53013
+ });
53014
+ formData.append('body', serialization_serializeObj(message));
53015
+ // Make the axios call
53016
+ axiosResponse = await lib_axios.post(url, formData, {
53017
+ headers: Object.assign({}, headers),
53018
+ responseType: 'text',
53019
+ });
53020
+ }
53021
+ else {
53022
+ axiosResponse = await lib_axios.post(url, serialization_serializeObj(message), {
53023
+ headers: Object.assign(Object.assign({}, headers), { 'Content-Type': 'application/json' }),
53024
+ responseType: 'text',
53025
+ });
53026
+ }
49111
53027
  }
49112
- else {
49113
- headers['Content-Type'] = 'application/json';
49114
- response = await external_cross_fetch_default()(url, {
49115
- method: 'POST',
49116
- body: serialization_serializeObj(message),
49117
- headers,
49118
- });
53028
+ catch (e) {
53029
+ if (e instanceof axios_AxiosError) {
53030
+ const response = e.response;
53031
+ if (!response)
53032
+ throw e;
53033
+ let message;
53034
+ try {
53035
+ const errorResponse = this.tryDeserializing(response.data);
53036
+ message = typeof errorResponse === 'string' ? errorResponse : errorResponse['message'];
53037
+ }
53038
+ catch (_a) { }
53039
+ if (!message)
53040
+ message = response.statusText;
53041
+ throw new RpcError(response.status, response.statusText, response.headers, url, message);
53042
+ }
53043
+ else {
53044
+ throw e;
53045
+ }
49119
53046
  }
49120
- const parsedResponse = await this.parseResponse(response);
53047
+ const parsedResponse = this.tryDeserializing(axiosResponse.data);
49121
53048
  DebugLogger.debug(`received response: ${JSON.stringify(parsedResponse)}`);
49122
53049
  return parsedResponse;
49123
53050
  }
49124
- catch (e) {
49125
- DebugLogger.debug(`received error: ${JSON.stringify(e)}`);
49126
- throw e;
49127
- }
49128
53051
  finally {
49129
53052
  this.onGoingRpcCounter.next(this.onGoingRpcCounter.value - 1);
49130
53053
  }
49131
53054
  }
49132
- async parseResponse(response) {
49133
- let text;
49134
- let json;
53055
+ tryDeserializing(text) {
53056
+ if (!text)
53057
+ return undefined;
49135
53058
  try {
49136
- text = await response.text();
49137
- try {
49138
- json = deserializeObj(text);
49139
- }
49140
- catch (_a) { }
49141
- }
49142
- catch (_b) {
49143
- text = 'Cannot read body';
53059
+ return deserializeObj(text);
49144
53060
  }
49145
- if (!response.ok) {
49146
- throw new RpcError(response.status, response.statusText, response.headers, response.url, json === null || json === void 0 ? void 0 : json['message']);
49147
- }
49148
- return (json || text);
53061
+ catch (_a) { }
53062
+ return text;
49149
53063
  }
49150
53064
  getRateLimiterBucket(path) {
49151
53065
  if (path.startsWith('ai/chatbot')) {
@@ -49350,14 +53264,14 @@ class SocketManager {
49350
53264
  this.socket = createWebSocketWrapper(socketUri, {
49351
53265
  timeout: 5000,
49352
53266
  onmessage: (e) => this.onMessage(e.data),
49353
- onopen: (_e) => {
53267
+ onopen: () => {
49354
53268
  DebugLogger.debug(`Connection to socket established. Endpoint: ${endpoint}`);
49355
53269
  },
49356
- onreconnect: (_e) => {
53270
+ onreconnect: () => {
49357
53271
  DebugLogger.debug(`WebSocket reconnect event triggered`);
49358
53272
  this.connectionReady.next(false);
49359
53273
  },
49360
- onclose: (_e) => {
53274
+ onclose: () => {
49361
53275
  DebugLogger.debug(`WebSocket onclose event triggered`);
49362
53276
  this.connectionReady.next(false);
49363
53277
  },
@@ -49521,10 +53435,25 @@ class NativeQueryManager {
49521
53435
  }
49522
53436
 
49523
53437
  ;// CONCATENATED MODULE: ./src/ai-assistant-client.ts
53438
+ /**
53439
+ * Client class for interacting with an AI Assistant server.
53440
+ * Provides functionalities like creating and deleting assistants and threads,
53441
+ * querying assistants, and managing files associated with assistants and threads.
53442
+ */
49524
53443
  class AiAssistantClient {
49525
53444
  constructor(rpcManager) {
49526
53445
  this.rpcManager = rpcManager;
49527
53446
  }
53447
+ /**
53448
+ * Creates a new AI assistant with specified characteristics.
53449
+ * @param name - The name of the assistant.
53450
+ * @param instructions - Instructions for the assistant.
53451
+ * @param functions - Array of function names annotated with "@aiFunction" in your Squid backend that will be
53452
+ * available tol the assistant.
53453
+ * @param toolTypes - Optional array of tool types. If you want to use files for retrieval, you must add them using
53454
+ * the addFileToAssistant method.
53455
+ * @returns A promise that resolves to the created assistant's ID.
53456
+ */
49528
53457
  async createAssistant(name, instructions, functions, toolTypes) {
49529
53458
  const request = {
49530
53459
  name,
@@ -49535,12 +53464,23 @@ class AiAssistantClient {
49535
53464
  const response = await this.rpcManager.post('ai/assistant/createAssistant', request);
49536
53465
  return response.assistantId;
49537
53466
  }
53467
+ /**
53468
+ * Deletes an AI assistant.
53469
+ * @param assistantId - The ID of the assistant to be deleted.
53470
+ * @returns A promise that resolves when the assistant is deleted.
53471
+ */
49538
53472
  async deleteAssistant(assistantId) {
49539
53473
  const request = {
49540
53474
  assistantId,
49541
53475
  };
49542
53476
  await this.rpcManager.post('ai/assistant/deleteAssistant', request);
49543
53477
  }
53478
+ /**
53479
+ * Creates a new thread for an AI assistant. A thread is a long-lived conversation with the assistant that you can
53480
+ * always send questions to.
53481
+ * @param assistantId - The ID of the assistant for which the thread is created.
53482
+ * @returns A promise that resolves to the created thread's ID.
53483
+ */
49544
53484
  async createThread(assistantId) {
49545
53485
  const request = {
49546
53486
  assistantId,
@@ -49548,35 +53488,98 @@ class AiAssistantClient {
49548
53488
  const response = await this.rpcManager.post('ai/assistant/createThread', request);
49549
53489
  return response.threadId;
49550
53490
  }
53491
+ /**
53492
+ * Deletes a thread of an AI assistant.
53493
+ * @param threadId - The ID of the thread to be deleted.
53494
+ * @returns A promise that resolves when the thread is deleted.
53495
+ */
49551
53496
  async deleteThread(threadId) {
49552
53497
  const request = {
49553
53498
  threadId,
49554
53499
  };
49555
53500
  await this.rpcManager.post('ai/assistant/deleteThread', request);
49556
53501
  }
49557
- async queryAssistant(assistantId, threadId, prompt, fileContent) {
53502
+ /**
53503
+ * Queries an AI assistant within a specific thread.
53504
+ * @param assistantId - The ID of the assistant.
53505
+ * @param threadId - The ID of the thread.
53506
+ * @param prompt - The query prompt.
53507
+ * @param fileIds - Optional array of file IDs to include in the query. These file IDs need to be added using the
53508
+ * addFileToThread method.
53509
+ * @returns A promise that resolves to the assistant's response.
53510
+ */
53511
+ async queryAssistant(assistantId, threadId, prompt, fileIds) {
49558
53512
  const request = {
49559
53513
  assistantId,
49560
53514
  threadId,
49561
53515
  prompt,
49562
- fileContent,
53516
+ fileIds,
49563
53517
  };
49564
53518
  const response = await this.rpcManager.post('ai/assistant/queryAssistant', request);
49565
53519
  return response.answer;
49566
53520
  }
53521
+ /**
53522
+ * Adds a file to an AI assistant that can be available for retrieval or code analyzer.
53523
+ * @param assistantId - The ID of the assistant.
53524
+ * @param file - The file or blob and filename to be added.
53525
+ * @returns A promise that resolves to the ID of the added file.
53526
+ */
53527
+ async addFileToAssistant(assistantId, file) {
53528
+ const request = { assistantId };
53529
+ const response = await this.rpcManager.post(`ai/assistant/addFileToAssistant`, request, [file], 'file');
53530
+ return response.fileId;
53531
+ }
53532
+ /**
53533
+ * Removes a file from an AI assistant.
53534
+ * @param assistantId - The ID of the assistant.
53535
+ * @param fileId - The ID of the file to be removed.
53536
+ * @returns A promise that resolves when the file is removed.
53537
+ */
53538
+ async removeFileFromAssistant(assistantId, fileId) {
53539
+ const request = {
53540
+ assistantId,
53541
+ fileId,
53542
+ };
53543
+ await this.rpcManager.post('ai/assistant/removeFileFromAssistant', request);
53544
+ }
53545
+ /**
53546
+ * Adds a file to a specific thread of an AI assistant. These files can be used when asking a question in the thread.
53547
+ * @param threadId - The ID of the thread.
53548
+ * @param file - The file or blob and filename to be added.
53549
+ * @returns A promise that resolves to the ID of the added file.
53550
+ */
53551
+ async addFileToThread(threadId, file) {
53552
+ const request = { threadId };
53553
+ const response = await this.rpcManager.post(`ai/assistant/addFileToThread`, request, [file], 'file');
53554
+ return response.fileId;
53555
+ }
49567
53556
  }
49568
53557
 
49569
53558
  ;// CONCATENATED MODULE: ./src/ai.types.ts
49570
53559
 
53560
+ /**
53561
+ * AiClient class serves as a facade for interacting with different AI services.
53562
+ * It provides simplified access to AI chatbot and assistant functionalities
53563
+ * through its methods.
53564
+ */
49571
53565
  class AiClient {
49572
53566
  constructor(aiChatbotClientFactory, rpcManager) {
49573
53567
  this.aiChatbotClientFactory = aiChatbotClientFactory;
49574
53568
  this.rpcManager = rpcManager;
49575
53569
  this.aiAssistantClient = new AiAssistantClient(this.rpcManager);
49576
53570
  }
49577
- chatbot(integrationId) {
49578
- return this.aiChatbotClientFactory.getChatbot(integrationId);
53571
+ /**
53572
+ * Retrieves an AI chatbot client for a specific AI integration.
53573
+ * @param aiIntegrationId - The identifier for the AI integration.
53574
+ * @returns An instance of AiChatbotClient associated with the given AI integration ID.
53575
+ */
53576
+ chatbot(aiIntegrationId) {
53577
+ return this.aiChatbotClientFactory.getChatbot(aiIntegrationId);
49579
53578
  }
53579
+ /**
53580
+ * Retrieves the AI assistant client.
53581
+ * @returns An instance of AiAssistantClient.
53582
+ */
49580
53583
  assistant() {
49581
53584
  return this.aiAssistantClient;
49582
53585
  }
@@ -49655,23 +53658,6 @@ class Squid {
49655
53658
  constructor(options) {
49656
53659
  this.options = options;
49657
53660
  this.destructManager = new DestructManager();
49658
- // Note: The following methods are bound using arrow functions to ensure that if a user accesses the methods via
49659
- // destructuring (i.e. `{ setAuthIdToken } = squid`) then `this` will still be bound to the Squid class.
49660
- /**
49661
- * Sets the authorization access token (OAuth2.0) that will be sent to the server and will be used for providing the
49662
- * `auth` object to the security rules.
49663
- *
49664
- * @deprecated: pass `AuthTokenProvider` in the constructor of the class.
49665
- *
49666
- * @param accessToken The OAuth2.0 access token or a promise that resolves with the access token.
49667
- * When undefined, no authorization information is sent.
49668
- * The Observable variant of the parameter is deprecated and will be removed soon.
49669
- * @param integrationId The id of the integration.
49670
- * @returns void
49671
- */
49672
- this.setAuthIdToken = (accessToken, integrationId) => {
49673
- this.authManager.setAuthIdToken(accessToken, integrationId);
49674
- };
49675
53661
  /**
49676
53662
  * Returns a reference to the collection in the provided integration.
49677
53663
  *
@@ -49909,6 +53895,8 @@ class Squid {
49909
53895
  static getInstances() {
49910
53896
  return Object.values(Squid.squidInstancesMap);
49911
53897
  }
53898
+ // Note: The following methods are bound using arrow functions to ensure that if a user accesses the methods via
53899
+ // destructuring (i.e. `{ setAuthProvider } = squid`) then `this` will still be bound to the Squid class.
49912
53900
  /**
49913
53901
  * Sets the authorization access token (OAuth2.0) provider that will be sent to the server and will be used for
49914
53902
  * providing the `auth` object to the security rules.