@ptkl/sdk 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -9,6 +9,7 @@ var require$$3 = require('http');
9
9
  var require$$4 = require('https');
10
10
  var require$$0$1 = require('url');
11
11
  var require$$6 = require('fs');
12
+ var require$$8 = require('crypto');
12
13
  var require$$4$1 = require('assert');
13
14
  var zlib = require('zlib');
14
15
  var events = require('events');
@@ -23,6 +24,7 @@ function bind(fn, thisArg) {
23
24
 
24
25
  const {toString} = Object.prototype;
25
26
  const {getPrototypeOf} = Object;
27
+ const {iterator, toStringTag} = Symbol;
26
28
 
27
29
  const kindOf = (cache => thing => {
28
30
  const str = toString.call(thing);
@@ -149,7 +151,28 @@ const isPlainObject = (val) => {
149
151
  }
150
152
 
151
153
  const prototype = getPrototypeOf(val);
152
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
154
+ return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
155
+ };
156
+
157
+ /**
158
+ * Determine if a value is an empty object (safely handles Buffers)
159
+ *
160
+ * @param {*} val The value to test
161
+ *
162
+ * @returns {boolean} True if value is an empty object, otherwise false
163
+ */
164
+ const isEmptyObject = (val) => {
165
+ // Early return for non-objects or Buffers to prevent RangeError
166
+ if (!isObject(val) || isBuffer(val)) {
167
+ return false;
168
+ }
169
+
170
+ try {
171
+ return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
172
+ } catch (e) {
173
+ // Fallback for any other objects that might cause RangeError with Object.keys()
174
+ return false;
175
+ }
153
176
  };
154
177
 
155
178
  /**
@@ -274,6 +297,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
274
297
  fn.call(null, obj[i], i, obj);
275
298
  }
276
299
  } else {
300
+ // Buffer check
301
+ if (isBuffer(obj)) {
302
+ return;
303
+ }
304
+
277
305
  // Iterate over object keys
278
306
  const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
279
307
  const len = keys.length;
@@ -287,6 +315,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
287
315
  }
288
316
 
289
317
  function findKey(obj, key) {
318
+ if (isBuffer(obj)){
319
+ return null;
320
+ }
321
+
290
322
  key = key.toLowerCase();
291
323
  const keys = Object.keys(obj);
292
324
  let i = keys.length;
@@ -500,13 +532,13 @@ const isTypedArray = (TypedArray => {
500
532
  * @returns {void}
501
533
  */
502
534
  const forEachEntry = (obj, fn) => {
503
- const generator = obj && obj[Symbol.iterator];
535
+ const generator = obj && obj[iterator];
504
536
 
505
- const iterator = generator.call(obj);
537
+ const _iterator = generator.call(obj);
506
538
 
507
539
  let result;
508
540
 
509
- while ((result = iterator.next()) && !result.done) {
541
+ while ((result = _iterator.next()) && !result.done) {
510
542
  const pair = result.value;
511
543
  fn.call(obj, pair[0], pair[1]);
512
544
  }
@@ -619,26 +651,6 @@ const toFiniteNumber = (value, defaultValue) => {
619
651
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
620
652
  };
621
653
 
622
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
623
-
624
- const DIGIT = '0123456789';
625
-
626
- const ALPHABET = {
627
- DIGIT,
628
- ALPHA,
629
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
630
- };
631
-
632
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
633
- let str = '';
634
- const {length} = alphabet;
635
- while (size--) {
636
- str += alphabet[Math.random() * length|0];
637
- }
638
-
639
- return str;
640
- };
641
-
642
654
  /**
643
655
  * If the thing is a FormData object, return true, otherwise return false.
644
656
  *
@@ -647,7 +659,7 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
647
659
  * @returns {boolean}
648
660
  */
649
661
  function isSpecCompliantForm(thing) {
650
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
662
+ return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
651
663
  }
652
664
 
653
665
  const toJSONObject = (obj) => {
@@ -660,6 +672,11 @@ const toJSONObject = (obj) => {
660
672
  return;
661
673
  }
662
674
 
675
+ //Buffer check
676
+ if (isBuffer(source)) {
677
+ return source;
678
+ }
679
+
663
680
  if(!('toJSON' in source)) {
664
681
  stack[i] = source;
665
682
  const target = isArray(source) ? [] : {};
@@ -716,6 +733,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
716
733
 
717
734
  // *********************
718
735
 
736
+
737
+ const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
738
+
739
+
719
740
  var utils$1 = {
720
741
  isArray,
721
742
  isArrayBuffer,
@@ -727,6 +748,7 @@ var utils$1 = {
727
748
  isBoolean,
728
749
  isObject,
729
750
  isPlainObject,
751
+ isEmptyObject,
730
752
  isReadableStream,
731
753
  isRequest,
732
754
  isResponse,
@@ -766,14 +788,13 @@ var utils$1 = {
766
788
  findKey,
767
789
  global: _global,
768
790
  isContextDefined,
769
- ALPHABET,
770
- generateString,
771
791
  isSpecCompliantForm,
772
792
  toJSONObject,
773
793
  isAsyncFn,
774
794
  isThenable,
775
795
  setImmediate: _setImmediate,
776
- asap
796
+ asap,
797
+ isIterable
777
798
  };
778
799
 
779
800
  /**
@@ -787,7 +808,7 @@ var utils$1 = {
787
808
  *
788
809
  * @returns {Error} The created error.
789
810
  */
790
- function AxiosError(message, code, config, request, response) {
811
+ function AxiosError$1(message, code, config, request, response) {
791
812
  Error.call(this);
792
813
 
793
814
  if (Error.captureStackTrace) {
@@ -807,7 +828,7 @@ function AxiosError(message, code, config, request, response) {
807
828
  }
808
829
  }
809
830
 
810
- utils$1.inherits(AxiosError, Error, {
831
+ utils$1.inherits(AxiosError$1, Error, {
811
832
  toJSON: function toJSON() {
812
833
  return {
813
834
  // Standard
@@ -829,7 +850,7 @@ utils$1.inherits(AxiosError, Error, {
829
850
  }
830
851
  });
831
852
 
832
- const prototype$1 = AxiosError.prototype;
853
+ const prototype$1 = AxiosError$1.prototype;
833
854
  const descriptors = {};
834
855
 
835
856
  [
@@ -850,11 +871,11 @@ const descriptors = {};
850
871
  descriptors[code] = {value: code};
851
872
  });
852
873
 
853
- Object.defineProperties(AxiosError, descriptors);
874
+ Object.defineProperties(AxiosError$1, descriptors);
854
875
  Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
855
876
 
856
877
  // eslint-disable-next-line func-names
857
- AxiosError.from = (error, code, config, request, response, customProps) => {
878
+ AxiosError$1.from = (error, code, config, request, response, customProps) => {
858
879
  const axiosError = Object.create(prototype$1);
859
880
 
860
881
  utils$1.toFlatObject(error, axiosError, function filter(obj) {
@@ -863,7 +884,7 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
863
884
  return prop !== 'isAxiosError';
864
885
  });
865
886
 
866
- AxiosError.call(axiosError, error.message, code, config, request, response);
887
+ AxiosError$1.call(axiosError, error.message, code, config, request, response);
867
888
 
868
889
  axiosError.cause = error;
869
890
 
@@ -12596,18 +12617,1092 @@ function requireAsynckit () {
12596
12617
  return asynckit;
12597
12618
  }
12598
12619
 
12620
+ var esObjectAtoms;
12621
+ var hasRequiredEsObjectAtoms;
12622
+
12623
+ function requireEsObjectAtoms () {
12624
+ if (hasRequiredEsObjectAtoms) return esObjectAtoms;
12625
+ hasRequiredEsObjectAtoms = 1;
12626
+
12627
+ /** @type {import('.')} */
12628
+ esObjectAtoms = Object;
12629
+ return esObjectAtoms;
12630
+ }
12631
+
12632
+ var esErrors;
12633
+ var hasRequiredEsErrors;
12634
+
12635
+ function requireEsErrors () {
12636
+ if (hasRequiredEsErrors) return esErrors;
12637
+ hasRequiredEsErrors = 1;
12638
+
12639
+ /** @type {import('.')} */
12640
+ esErrors = Error;
12641
+ return esErrors;
12642
+ }
12643
+
12644
+ var _eval;
12645
+ var hasRequired_eval;
12646
+
12647
+ function require_eval () {
12648
+ if (hasRequired_eval) return _eval;
12649
+ hasRequired_eval = 1;
12650
+
12651
+ /** @type {import('./eval')} */
12652
+ _eval = EvalError;
12653
+ return _eval;
12654
+ }
12655
+
12656
+ var range;
12657
+ var hasRequiredRange;
12658
+
12659
+ function requireRange () {
12660
+ if (hasRequiredRange) return range;
12661
+ hasRequiredRange = 1;
12662
+
12663
+ /** @type {import('./range')} */
12664
+ range = RangeError;
12665
+ return range;
12666
+ }
12667
+
12668
+ var ref;
12669
+ var hasRequiredRef;
12670
+
12671
+ function requireRef () {
12672
+ if (hasRequiredRef) return ref;
12673
+ hasRequiredRef = 1;
12674
+
12675
+ /** @type {import('./ref')} */
12676
+ ref = ReferenceError;
12677
+ return ref;
12678
+ }
12679
+
12680
+ var syntax;
12681
+ var hasRequiredSyntax;
12682
+
12683
+ function requireSyntax () {
12684
+ if (hasRequiredSyntax) return syntax;
12685
+ hasRequiredSyntax = 1;
12686
+
12687
+ /** @type {import('./syntax')} */
12688
+ syntax = SyntaxError;
12689
+ return syntax;
12690
+ }
12691
+
12692
+ var type;
12693
+ var hasRequiredType;
12694
+
12695
+ function requireType () {
12696
+ if (hasRequiredType) return type;
12697
+ hasRequiredType = 1;
12698
+
12699
+ /** @type {import('./type')} */
12700
+ type = TypeError;
12701
+ return type;
12702
+ }
12703
+
12704
+ var uri;
12705
+ var hasRequiredUri;
12706
+
12707
+ function requireUri () {
12708
+ if (hasRequiredUri) return uri;
12709
+ hasRequiredUri = 1;
12710
+
12711
+ /** @type {import('./uri')} */
12712
+ uri = URIError;
12713
+ return uri;
12714
+ }
12715
+
12716
+ var abs;
12717
+ var hasRequiredAbs;
12718
+
12719
+ function requireAbs () {
12720
+ if (hasRequiredAbs) return abs;
12721
+ hasRequiredAbs = 1;
12722
+
12723
+ /** @type {import('./abs')} */
12724
+ abs = Math.abs;
12725
+ return abs;
12726
+ }
12727
+
12728
+ var floor;
12729
+ var hasRequiredFloor;
12730
+
12731
+ function requireFloor () {
12732
+ if (hasRequiredFloor) return floor;
12733
+ hasRequiredFloor = 1;
12734
+
12735
+ /** @type {import('./floor')} */
12736
+ floor = Math.floor;
12737
+ return floor;
12738
+ }
12739
+
12740
+ var max;
12741
+ var hasRequiredMax;
12742
+
12743
+ function requireMax () {
12744
+ if (hasRequiredMax) return max;
12745
+ hasRequiredMax = 1;
12746
+
12747
+ /** @type {import('./max')} */
12748
+ max = Math.max;
12749
+ return max;
12750
+ }
12751
+
12752
+ var min;
12753
+ var hasRequiredMin;
12754
+
12755
+ function requireMin () {
12756
+ if (hasRequiredMin) return min;
12757
+ hasRequiredMin = 1;
12758
+
12759
+ /** @type {import('./min')} */
12760
+ min = Math.min;
12761
+ return min;
12762
+ }
12763
+
12764
+ var pow;
12765
+ var hasRequiredPow;
12766
+
12767
+ function requirePow () {
12768
+ if (hasRequiredPow) return pow;
12769
+ hasRequiredPow = 1;
12770
+
12771
+ /** @type {import('./pow')} */
12772
+ pow = Math.pow;
12773
+ return pow;
12774
+ }
12775
+
12776
+ var round;
12777
+ var hasRequiredRound;
12778
+
12779
+ function requireRound () {
12780
+ if (hasRequiredRound) return round;
12781
+ hasRequiredRound = 1;
12782
+
12783
+ /** @type {import('./round')} */
12784
+ round = Math.round;
12785
+ return round;
12786
+ }
12787
+
12788
+ var _isNaN;
12789
+ var hasRequired_isNaN;
12790
+
12791
+ function require_isNaN () {
12792
+ if (hasRequired_isNaN) return _isNaN;
12793
+ hasRequired_isNaN = 1;
12794
+
12795
+ /** @type {import('./isNaN')} */
12796
+ _isNaN = Number.isNaN || function isNaN(a) {
12797
+ return a !== a;
12798
+ };
12799
+ return _isNaN;
12800
+ }
12801
+
12802
+ var sign;
12803
+ var hasRequiredSign;
12804
+
12805
+ function requireSign () {
12806
+ if (hasRequiredSign) return sign;
12807
+ hasRequiredSign = 1;
12808
+
12809
+ var $isNaN = /*@__PURE__*/ require_isNaN();
12810
+
12811
+ /** @type {import('./sign')} */
12812
+ sign = function sign(number) {
12813
+ if ($isNaN(number) || number === 0) {
12814
+ return number;
12815
+ }
12816
+ return number < 0 ? -1 : 1;
12817
+ };
12818
+ return sign;
12819
+ }
12820
+
12821
+ var gOPD;
12822
+ var hasRequiredGOPD;
12823
+
12824
+ function requireGOPD () {
12825
+ if (hasRequiredGOPD) return gOPD;
12826
+ hasRequiredGOPD = 1;
12827
+
12828
+ /** @type {import('./gOPD')} */
12829
+ gOPD = Object.getOwnPropertyDescriptor;
12830
+ return gOPD;
12831
+ }
12832
+
12833
+ var gopd;
12834
+ var hasRequiredGopd;
12835
+
12836
+ function requireGopd () {
12837
+ if (hasRequiredGopd) return gopd;
12838
+ hasRequiredGopd = 1;
12839
+
12840
+ /** @type {import('.')} */
12841
+ var $gOPD = /*@__PURE__*/ requireGOPD();
12842
+
12843
+ if ($gOPD) {
12844
+ try {
12845
+ $gOPD([], 'length');
12846
+ } catch (e) {
12847
+ // IE 8 has a broken gOPD
12848
+ $gOPD = null;
12849
+ }
12850
+ }
12851
+
12852
+ gopd = $gOPD;
12853
+ return gopd;
12854
+ }
12855
+
12856
+ var esDefineProperty;
12857
+ var hasRequiredEsDefineProperty;
12858
+
12859
+ function requireEsDefineProperty () {
12860
+ if (hasRequiredEsDefineProperty) return esDefineProperty;
12861
+ hasRequiredEsDefineProperty = 1;
12862
+
12863
+ /** @type {import('.')} */
12864
+ var $defineProperty = Object.defineProperty || false;
12865
+ if ($defineProperty) {
12866
+ try {
12867
+ $defineProperty({}, 'a', { value: 1 });
12868
+ } catch (e) {
12869
+ // IE 8 has a broken defineProperty
12870
+ $defineProperty = false;
12871
+ }
12872
+ }
12873
+
12874
+ esDefineProperty = $defineProperty;
12875
+ return esDefineProperty;
12876
+ }
12877
+
12878
+ var shams$1;
12879
+ var hasRequiredShams$1;
12880
+
12881
+ function requireShams$1 () {
12882
+ if (hasRequiredShams$1) return shams$1;
12883
+ hasRequiredShams$1 = 1;
12884
+
12885
+ /** @type {import('./shams')} */
12886
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
12887
+ shams$1 = function hasSymbols() {
12888
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
12889
+ if (typeof Symbol.iterator === 'symbol') { return true; }
12890
+
12891
+ /** @type {{ [k in symbol]?: unknown }} */
12892
+ var obj = {};
12893
+ var sym = Symbol('test');
12894
+ var symObj = Object(sym);
12895
+ if (typeof sym === 'string') { return false; }
12896
+
12897
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
12898
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
12899
+
12900
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
12901
+ // if (sym instanceof Symbol) { return false; }
12902
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
12903
+ // if (!(symObj instanceof Symbol)) { return false; }
12904
+
12905
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
12906
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
12907
+
12908
+ var symVal = 42;
12909
+ obj[sym] = symVal;
12910
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
12911
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
12912
+
12913
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
12914
+
12915
+ var syms = Object.getOwnPropertySymbols(obj);
12916
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
12917
+
12918
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
12919
+
12920
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
12921
+ // eslint-disable-next-line no-extra-parens
12922
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
12923
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
12924
+ }
12925
+
12926
+ return true;
12927
+ };
12928
+ return shams$1;
12929
+ }
12930
+
12931
+ var hasSymbols;
12932
+ var hasRequiredHasSymbols;
12933
+
12934
+ function requireHasSymbols () {
12935
+ if (hasRequiredHasSymbols) return hasSymbols;
12936
+ hasRequiredHasSymbols = 1;
12937
+
12938
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
12939
+ var hasSymbolSham = requireShams$1();
12940
+
12941
+ /** @type {import('.')} */
12942
+ hasSymbols = function hasNativeSymbols() {
12943
+ if (typeof origSymbol !== 'function') { return false; }
12944
+ if (typeof Symbol !== 'function') { return false; }
12945
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
12946
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
12947
+
12948
+ return hasSymbolSham();
12949
+ };
12950
+ return hasSymbols;
12951
+ }
12952
+
12953
+ var Reflect_getPrototypeOf;
12954
+ var hasRequiredReflect_getPrototypeOf;
12955
+
12956
+ function requireReflect_getPrototypeOf () {
12957
+ if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
12958
+ hasRequiredReflect_getPrototypeOf = 1;
12959
+
12960
+ /** @type {import('./Reflect.getPrototypeOf')} */
12961
+ Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
12962
+ return Reflect_getPrototypeOf;
12963
+ }
12964
+
12965
+ var Object_getPrototypeOf;
12966
+ var hasRequiredObject_getPrototypeOf;
12967
+
12968
+ function requireObject_getPrototypeOf () {
12969
+ if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
12970
+ hasRequiredObject_getPrototypeOf = 1;
12971
+
12972
+ var $Object = /*@__PURE__*/ requireEsObjectAtoms();
12973
+
12974
+ /** @type {import('./Object.getPrototypeOf')} */
12975
+ Object_getPrototypeOf = $Object.getPrototypeOf || null;
12976
+ return Object_getPrototypeOf;
12977
+ }
12978
+
12979
+ var implementation;
12980
+ var hasRequiredImplementation;
12981
+
12982
+ function requireImplementation () {
12983
+ if (hasRequiredImplementation) return implementation;
12984
+ hasRequiredImplementation = 1;
12985
+
12986
+ /* eslint no-invalid-this: 1 */
12987
+
12988
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
12989
+ var toStr = Object.prototype.toString;
12990
+ var max = Math.max;
12991
+ var funcType = '[object Function]';
12992
+
12993
+ var concatty = function concatty(a, b) {
12994
+ var arr = [];
12995
+
12996
+ for (var i = 0; i < a.length; i += 1) {
12997
+ arr[i] = a[i];
12998
+ }
12999
+ for (var j = 0; j < b.length; j += 1) {
13000
+ arr[j + a.length] = b[j];
13001
+ }
13002
+
13003
+ return arr;
13004
+ };
13005
+
13006
+ var slicy = function slicy(arrLike, offset) {
13007
+ var arr = [];
13008
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
13009
+ arr[j] = arrLike[i];
13010
+ }
13011
+ return arr;
13012
+ };
13013
+
13014
+ var joiny = function (arr, joiner) {
13015
+ var str = '';
13016
+ for (var i = 0; i < arr.length; i += 1) {
13017
+ str += arr[i];
13018
+ if (i + 1 < arr.length) {
13019
+ str += joiner;
13020
+ }
13021
+ }
13022
+ return str;
13023
+ };
13024
+
13025
+ implementation = function bind(that) {
13026
+ var target = this;
13027
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
13028
+ throw new TypeError(ERROR_MESSAGE + target);
13029
+ }
13030
+ var args = slicy(arguments, 1);
13031
+
13032
+ var bound;
13033
+ var binder = function () {
13034
+ if (this instanceof bound) {
13035
+ var result = target.apply(
13036
+ this,
13037
+ concatty(args, arguments)
13038
+ );
13039
+ if (Object(result) === result) {
13040
+ return result;
13041
+ }
13042
+ return this;
13043
+ }
13044
+ return target.apply(
13045
+ that,
13046
+ concatty(args, arguments)
13047
+ );
13048
+
13049
+ };
13050
+
13051
+ var boundLength = max(0, target.length - args.length);
13052
+ var boundArgs = [];
13053
+ for (var i = 0; i < boundLength; i++) {
13054
+ boundArgs[i] = '$' + i;
13055
+ }
13056
+
13057
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
13058
+
13059
+ if (target.prototype) {
13060
+ var Empty = function Empty() {};
13061
+ Empty.prototype = target.prototype;
13062
+ bound.prototype = new Empty();
13063
+ Empty.prototype = null;
13064
+ }
13065
+
13066
+ return bound;
13067
+ };
13068
+ return implementation;
13069
+ }
13070
+
13071
+ var functionBind;
13072
+ var hasRequiredFunctionBind;
13073
+
13074
+ function requireFunctionBind () {
13075
+ if (hasRequiredFunctionBind) return functionBind;
13076
+ hasRequiredFunctionBind = 1;
13077
+
13078
+ var implementation = requireImplementation();
13079
+
13080
+ functionBind = Function.prototype.bind || implementation;
13081
+ return functionBind;
13082
+ }
13083
+
13084
+ var functionCall;
13085
+ var hasRequiredFunctionCall;
13086
+
13087
+ function requireFunctionCall () {
13088
+ if (hasRequiredFunctionCall) return functionCall;
13089
+ hasRequiredFunctionCall = 1;
13090
+
13091
+ /** @type {import('./functionCall')} */
13092
+ functionCall = Function.prototype.call;
13093
+ return functionCall;
13094
+ }
13095
+
13096
+ var functionApply;
13097
+ var hasRequiredFunctionApply;
13098
+
13099
+ function requireFunctionApply () {
13100
+ if (hasRequiredFunctionApply) return functionApply;
13101
+ hasRequiredFunctionApply = 1;
13102
+
13103
+ /** @type {import('./functionApply')} */
13104
+ functionApply = Function.prototype.apply;
13105
+ return functionApply;
13106
+ }
13107
+
13108
+ var reflectApply;
13109
+ var hasRequiredReflectApply;
13110
+
13111
+ function requireReflectApply () {
13112
+ if (hasRequiredReflectApply) return reflectApply;
13113
+ hasRequiredReflectApply = 1;
13114
+
13115
+ /** @type {import('./reflectApply')} */
13116
+ reflectApply = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
13117
+ return reflectApply;
13118
+ }
13119
+
13120
+ var actualApply;
13121
+ var hasRequiredActualApply;
13122
+
13123
+ function requireActualApply () {
13124
+ if (hasRequiredActualApply) return actualApply;
13125
+ hasRequiredActualApply = 1;
13126
+
13127
+ var bind = requireFunctionBind();
13128
+
13129
+ var $apply = requireFunctionApply();
13130
+ var $call = requireFunctionCall();
13131
+ var $reflectApply = requireReflectApply();
13132
+
13133
+ /** @type {import('./actualApply')} */
13134
+ actualApply = $reflectApply || bind.call($call, $apply);
13135
+ return actualApply;
13136
+ }
13137
+
13138
+ var callBindApplyHelpers;
13139
+ var hasRequiredCallBindApplyHelpers;
13140
+
13141
+ function requireCallBindApplyHelpers () {
13142
+ if (hasRequiredCallBindApplyHelpers) return callBindApplyHelpers;
13143
+ hasRequiredCallBindApplyHelpers = 1;
13144
+
13145
+ var bind = requireFunctionBind();
13146
+ var $TypeError = /*@__PURE__*/ requireType();
13147
+
13148
+ var $call = requireFunctionCall();
13149
+ var $actualApply = requireActualApply();
13150
+
13151
+ /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
13152
+ callBindApplyHelpers = function callBindBasic(args) {
13153
+ if (args.length < 1 || typeof args[0] !== 'function') {
13154
+ throw new $TypeError('a function is required');
13155
+ }
13156
+ return $actualApply(bind, $call, args);
13157
+ };
13158
+ return callBindApplyHelpers;
13159
+ }
13160
+
13161
+ var get;
13162
+ var hasRequiredGet;
13163
+
13164
+ function requireGet () {
13165
+ if (hasRequiredGet) return get;
13166
+ hasRequiredGet = 1;
13167
+
13168
+ var callBind = requireCallBindApplyHelpers();
13169
+ var gOPD = /*@__PURE__*/ requireGopd();
13170
+
13171
+ var hasProtoAccessor;
13172
+ try {
13173
+ // eslint-disable-next-line no-extra-parens, no-proto
13174
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
13175
+ } catch (e) {
13176
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
13177
+ throw e;
13178
+ }
13179
+ }
13180
+
13181
+ // eslint-disable-next-line no-extra-parens
13182
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
13183
+
13184
+ var $Object = Object;
13185
+ var $getPrototypeOf = $Object.getPrototypeOf;
13186
+
13187
+ /** @type {import('./get')} */
13188
+ get = desc && typeof desc.get === 'function'
13189
+ ? callBind([desc.get])
13190
+ : typeof $getPrototypeOf === 'function'
13191
+ ? /** @type {import('./get')} */ function getDunder(value) {
13192
+ // eslint-disable-next-line eqeqeq
13193
+ return $getPrototypeOf(value == null ? value : $Object(value));
13194
+ }
13195
+ : false;
13196
+ return get;
13197
+ }
13198
+
13199
+ var getProto;
13200
+ var hasRequiredGetProto;
13201
+
13202
+ function requireGetProto () {
13203
+ if (hasRequiredGetProto) return getProto;
13204
+ hasRequiredGetProto = 1;
13205
+
13206
+ var reflectGetProto = requireReflect_getPrototypeOf();
13207
+ var originalGetProto = requireObject_getPrototypeOf();
13208
+
13209
+ var getDunderProto = /*@__PURE__*/ requireGet();
13210
+
13211
+ /** @type {import('.')} */
13212
+ getProto = reflectGetProto
13213
+ ? function getProto(O) {
13214
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
13215
+ return reflectGetProto(O);
13216
+ }
13217
+ : originalGetProto
13218
+ ? function getProto(O) {
13219
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
13220
+ throw new TypeError('getProto: not an object');
13221
+ }
13222
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
13223
+ return originalGetProto(O);
13224
+ }
13225
+ : getDunderProto
13226
+ ? function getProto(O) {
13227
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
13228
+ return getDunderProto(O);
13229
+ }
13230
+ : null;
13231
+ return getProto;
13232
+ }
13233
+
13234
+ var hasown;
13235
+ var hasRequiredHasown;
13236
+
13237
+ function requireHasown () {
13238
+ if (hasRequiredHasown) return hasown;
13239
+ hasRequiredHasown = 1;
13240
+
13241
+ var call = Function.prototype.call;
13242
+ var $hasOwn = Object.prototype.hasOwnProperty;
13243
+ var bind = requireFunctionBind();
13244
+
13245
+ /** @type {import('.')} */
13246
+ hasown = bind.call(call, $hasOwn);
13247
+ return hasown;
13248
+ }
13249
+
13250
+ var getIntrinsic;
13251
+ var hasRequiredGetIntrinsic;
13252
+
13253
+ function requireGetIntrinsic () {
13254
+ if (hasRequiredGetIntrinsic) return getIntrinsic;
13255
+ hasRequiredGetIntrinsic = 1;
13256
+
13257
+ var undefined$1;
13258
+
13259
+ var $Object = /*@__PURE__*/ requireEsObjectAtoms();
13260
+
13261
+ var $Error = /*@__PURE__*/ requireEsErrors();
13262
+ var $EvalError = /*@__PURE__*/ require_eval();
13263
+ var $RangeError = /*@__PURE__*/ requireRange();
13264
+ var $ReferenceError = /*@__PURE__*/ requireRef();
13265
+ var $SyntaxError = /*@__PURE__*/ requireSyntax();
13266
+ var $TypeError = /*@__PURE__*/ requireType();
13267
+ var $URIError = /*@__PURE__*/ requireUri();
13268
+
13269
+ var abs = /*@__PURE__*/ requireAbs();
13270
+ var floor = /*@__PURE__*/ requireFloor();
13271
+ var max = /*@__PURE__*/ requireMax();
13272
+ var min = /*@__PURE__*/ requireMin();
13273
+ var pow = /*@__PURE__*/ requirePow();
13274
+ var round = /*@__PURE__*/ requireRound();
13275
+ var sign = /*@__PURE__*/ requireSign();
13276
+
13277
+ var $Function = Function;
13278
+
13279
+ // eslint-disable-next-line consistent-return
13280
+ var getEvalledConstructor = function (expressionSyntax) {
13281
+ try {
13282
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
13283
+ } catch (e) {}
13284
+ };
13285
+
13286
+ var $gOPD = /*@__PURE__*/ requireGopd();
13287
+ var $defineProperty = /*@__PURE__*/ requireEsDefineProperty();
13288
+
13289
+ var throwTypeError = function () {
13290
+ throw new $TypeError();
13291
+ };
13292
+ var ThrowTypeError = $gOPD
13293
+ ? (function () {
13294
+ try {
13295
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
13296
+ arguments.callee; // IE 8 does not throw here
13297
+ return throwTypeError;
13298
+ } catch (calleeThrows) {
13299
+ try {
13300
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
13301
+ return $gOPD(arguments, 'callee').get;
13302
+ } catch (gOPDthrows) {
13303
+ return throwTypeError;
13304
+ }
13305
+ }
13306
+ }())
13307
+ : throwTypeError;
13308
+
13309
+ var hasSymbols = requireHasSymbols()();
13310
+
13311
+ var getProto = requireGetProto();
13312
+ var $ObjectGPO = requireObject_getPrototypeOf();
13313
+ var $ReflectGPO = requireReflect_getPrototypeOf();
13314
+
13315
+ var $apply = requireFunctionApply();
13316
+ var $call = requireFunctionCall();
13317
+
13318
+ var needsEval = {};
13319
+
13320
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
13321
+
13322
+ var INTRINSICS = {
13323
+ __proto__: null,
13324
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
13325
+ '%Array%': Array,
13326
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
13327
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
13328
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
13329
+ '%AsyncFunction%': needsEval,
13330
+ '%AsyncGenerator%': needsEval,
13331
+ '%AsyncGeneratorFunction%': needsEval,
13332
+ '%AsyncIteratorPrototype%': needsEval,
13333
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
13334
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
13335
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
13336
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
13337
+ '%Boolean%': Boolean,
13338
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
13339
+ '%Date%': Date,
13340
+ '%decodeURI%': decodeURI,
13341
+ '%decodeURIComponent%': decodeURIComponent,
13342
+ '%encodeURI%': encodeURI,
13343
+ '%encodeURIComponent%': encodeURIComponent,
13344
+ '%Error%': $Error,
13345
+ '%eval%': eval, // eslint-disable-line no-eval
13346
+ '%EvalError%': $EvalError,
13347
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
13348
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
13349
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
13350
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
13351
+ '%Function%': $Function,
13352
+ '%GeneratorFunction%': needsEval,
13353
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
13354
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
13355
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
13356
+ '%isFinite%': isFinite,
13357
+ '%isNaN%': isNaN,
13358
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
13359
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
13360
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
13361
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
13362
+ '%Math%': Math,
13363
+ '%Number%': Number,
13364
+ '%Object%': $Object,
13365
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
13366
+ '%parseFloat%': parseFloat,
13367
+ '%parseInt%': parseInt,
13368
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
13369
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
13370
+ '%RangeError%': $RangeError,
13371
+ '%ReferenceError%': $ReferenceError,
13372
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
13373
+ '%RegExp%': RegExp,
13374
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
13375
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
13376
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
13377
+ '%String%': String,
13378
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
13379
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
13380
+ '%SyntaxError%': $SyntaxError,
13381
+ '%ThrowTypeError%': ThrowTypeError,
13382
+ '%TypedArray%': TypedArray,
13383
+ '%TypeError%': $TypeError,
13384
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
13385
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
13386
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
13387
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
13388
+ '%URIError%': $URIError,
13389
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
13390
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
13391
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
13392
+
13393
+ '%Function.prototype.call%': $call,
13394
+ '%Function.prototype.apply%': $apply,
13395
+ '%Object.defineProperty%': $defineProperty,
13396
+ '%Object.getPrototypeOf%': $ObjectGPO,
13397
+ '%Math.abs%': abs,
13398
+ '%Math.floor%': floor,
13399
+ '%Math.max%': max,
13400
+ '%Math.min%': min,
13401
+ '%Math.pow%': pow,
13402
+ '%Math.round%': round,
13403
+ '%Math.sign%': sign,
13404
+ '%Reflect.getPrototypeOf%': $ReflectGPO
13405
+ };
13406
+
13407
+ if (getProto) {
13408
+ try {
13409
+ null.error; // eslint-disable-line no-unused-expressions
13410
+ } catch (e) {
13411
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
13412
+ var errorProto = getProto(getProto(e));
13413
+ INTRINSICS['%Error.prototype%'] = errorProto;
13414
+ }
13415
+ }
13416
+
13417
+ var doEval = function doEval(name) {
13418
+ var value;
13419
+ if (name === '%AsyncFunction%') {
13420
+ value = getEvalledConstructor('async function () {}');
13421
+ } else if (name === '%GeneratorFunction%') {
13422
+ value = getEvalledConstructor('function* () {}');
13423
+ } else if (name === '%AsyncGeneratorFunction%') {
13424
+ value = getEvalledConstructor('async function* () {}');
13425
+ } else if (name === '%AsyncGenerator%') {
13426
+ var fn = doEval('%AsyncGeneratorFunction%');
13427
+ if (fn) {
13428
+ value = fn.prototype;
13429
+ }
13430
+ } else if (name === '%AsyncIteratorPrototype%') {
13431
+ var gen = doEval('%AsyncGenerator%');
13432
+ if (gen && getProto) {
13433
+ value = getProto(gen.prototype);
13434
+ }
13435
+ }
13436
+
13437
+ INTRINSICS[name] = value;
13438
+
13439
+ return value;
13440
+ };
13441
+
13442
+ var LEGACY_ALIASES = {
13443
+ __proto__: null,
13444
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
13445
+ '%ArrayPrototype%': ['Array', 'prototype'],
13446
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
13447
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
13448
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
13449
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
13450
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
13451
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
13452
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
13453
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
13454
+ '%DataViewPrototype%': ['DataView', 'prototype'],
13455
+ '%DatePrototype%': ['Date', 'prototype'],
13456
+ '%ErrorPrototype%': ['Error', 'prototype'],
13457
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
13458
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
13459
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
13460
+ '%FunctionPrototype%': ['Function', 'prototype'],
13461
+ '%Generator%': ['GeneratorFunction', 'prototype'],
13462
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
13463
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
13464
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
13465
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
13466
+ '%JSONParse%': ['JSON', 'parse'],
13467
+ '%JSONStringify%': ['JSON', 'stringify'],
13468
+ '%MapPrototype%': ['Map', 'prototype'],
13469
+ '%NumberPrototype%': ['Number', 'prototype'],
13470
+ '%ObjectPrototype%': ['Object', 'prototype'],
13471
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
13472
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
13473
+ '%PromisePrototype%': ['Promise', 'prototype'],
13474
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
13475
+ '%Promise_all%': ['Promise', 'all'],
13476
+ '%Promise_reject%': ['Promise', 'reject'],
13477
+ '%Promise_resolve%': ['Promise', 'resolve'],
13478
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
13479
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
13480
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
13481
+ '%SetPrototype%': ['Set', 'prototype'],
13482
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
13483
+ '%StringPrototype%': ['String', 'prototype'],
13484
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
13485
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
13486
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
13487
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
13488
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
13489
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
13490
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
13491
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
13492
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
13493
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
13494
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
13495
+ };
13496
+
13497
+ var bind = requireFunctionBind();
13498
+ var hasOwn = /*@__PURE__*/ requireHasown();
13499
+ var $concat = bind.call($call, Array.prototype.concat);
13500
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
13501
+ var $replace = bind.call($call, String.prototype.replace);
13502
+ var $strSlice = bind.call($call, String.prototype.slice);
13503
+ var $exec = bind.call($call, RegExp.prototype.exec);
13504
+
13505
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
13506
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13507
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
13508
+ var stringToPath = function stringToPath(string) {
13509
+ var first = $strSlice(string, 0, 1);
13510
+ var last = $strSlice(string, -1);
13511
+ if (first === '%' && last !== '%') {
13512
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
13513
+ } else if (last === '%' && first !== '%') {
13514
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
13515
+ }
13516
+ var result = [];
13517
+ $replace(string, rePropName, function (match, number, quote, subString) {
13518
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
13519
+ });
13520
+ return result;
13521
+ };
13522
+ /* end adaptation */
13523
+
13524
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
13525
+ var intrinsicName = name;
13526
+ var alias;
13527
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
13528
+ alias = LEGACY_ALIASES[intrinsicName];
13529
+ intrinsicName = '%' + alias[0] + '%';
13530
+ }
13531
+
13532
+ if (hasOwn(INTRINSICS, intrinsicName)) {
13533
+ var value = INTRINSICS[intrinsicName];
13534
+ if (value === needsEval) {
13535
+ value = doEval(intrinsicName);
13536
+ }
13537
+ if (typeof value === 'undefined' && !allowMissing) {
13538
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
13539
+ }
13540
+
13541
+ return {
13542
+ alias: alias,
13543
+ name: intrinsicName,
13544
+ value: value
13545
+ };
13546
+ }
13547
+
13548
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
13549
+ };
13550
+
13551
+ getIntrinsic = function GetIntrinsic(name, allowMissing) {
13552
+ if (typeof name !== 'string' || name.length === 0) {
13553
+ throw new $TypeError('intrinsic name must be a non-empty string');
13554
+ }
13555
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
13556
+ throw new $TypeError('"allowMissing" argument must be a boolean');
13557
+ }
13558
+
13559
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
13560
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
13561
+ }
13562
+ var parts = stringToPath(name);
13563
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
13564
+
13565
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
13566
+ var intrinsicRealName = intrinsic.name;
13567
+ var value = intrinsic.value;
13568
+ var skipFurtherCaching = false;
13569
+
13570
+ var alias = intrinsic.alias;
13571
+ if (alias) {
13572
+ intrinsicBaseName = alias[0];
13573
+ $spliceApply(parts, $concat([0, 1], alias));
13574
+ }
13575
+
13576
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
13577
+ var part = parts[i];
13578
+ var first = $strSlice(part, 0, 1);
13579
+ var last = $strSlice(part, -1);
13580
+ if (
13581
+ (
13582
+ (first === '"' || first === "'" || first === '`')
13583
+ || (last === '"' || last === "'" || last === '`')
13584
+ )
13585
+ && first !== last
13586
+ ) {
13587
+ throw new $SyntaxError('property names with quotes must have matching quotes');
13588
+ }
13589
+ if (part === 'constructor' || !isOwn) {
13590
+ skipFurtherCaching = true;
13591
+ }
13592
+
13593
+ intrinsicBaseName += '.' + part;
13594
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
13595
+
13596
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
13597
+ value = INTRINSICS[intrinsicRealName];
13598
+ } else if (value != null) {
13599
+ if (!(part in value)) {
13600
+ if (!allowMissing) {
13601
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
13602
+ }
13603
+ return void undefined$1;
13604
+ }
13605
+ if ($gOPD && (i + 1) >= parts.length) {
13606
+ var desc = $gOPD(value, part);
13607
+ isOwn = !!desc;
13608
+
13609
+ // By convention, when a data property is converted to an accessor
13610
+ // property to emulate a data property that does not suffer from
13611
+ // the override mistake, that accessor's getter is marked with
13612
+ // an `originalValue` property. Here, when we detect this, we
13613
+ // uphold the illusion by pretending to see that original data
13614
+ // property, i.e., returning the value rather than the getter
13615
+ // itself.
13616
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
13617
+ value = desc.get;
13618
+ } else {
13619
+ value = value[part];
13620
+ }
13621
+ } else {
13622
+ isOwn = hasOwn(value, part);
13623
+ value = value[part];
13624
+ }
13625
+
13626
+ if (isOwn && !skipFurtherCaching) {
13627
+ INTRINSICS[intrinsicRealName] = value;
13628
+ }
13629
+ }
13630
+ }
13631
+ return value;
13632
+ };
13633
+ return getIntrinsic;
13634
+ }
13635
+
13636
+ var shams;
13637
+ var hasRequiredShams;
13638
+
13639
+ function requireShams () {
13640
+ if (hasRequiredShams) return shams;
13641
+ hasRequiredShams = 1;
13642
+
13643
+ var hasSymbols = requireShams$1();
13644
+
13645
+ /** @type {import('.')} */
13646
+ shams = function hasToStringTagShams() {
13647
+ return hasSymbols() && !!Symbol.toStringTag;
13648
+ };
13649
+ return shams;
13650
+ }
13651
+
13652
+ var esSetTostringtag;
13653
+ var hasRequiredEsSetTostringtag;
13654
+
13655
+ function requireEsSetTostringtag () {
13656
+ if (hasRequiredEsSetTostringtag) return esSetTostringtag;
13657
+ hasRequiredEsSetTostringtag = 1;
13658
+
13659
+ var GetIntrinsic = /*@__PURE__*/ requireGetIntrinsic();
13660
+
13661
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
13662
+
13663
+ var hasToStringTag = requireShams()();
13664
+ var hasOwn = /*@__PURE__*/ requireHasown();
13665
+ var $TypeError = /*@__PURE__*/ requireType();
13666
+
13667
+ var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
13668
+
13669
+ /** @type {import('.')} */
13670
+ esSetTostringtag = function setToStringTag(object, value) {
13671
+ var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
13672
+ var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
13673
+ if (
13674
+ (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')
13675
+ || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')
13676
+ ) {
13677
+ throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');
13678
+ }
13679
+ if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
13680
+ if ($defineProperty) {
13681
+ $defineProperty(object, toStringTag, {
13682
+ configurable: !nonConfigurable,
13683
+ enumerable: false,
13684
+ value: value,
13685
+ writable: false
13686
+ });
13687
+ } else {
13688
+ object[toStringTag] = value; // eslint-disable-line no-param-reassign
13689
+ }
13690
+ }
13691
+ };
13692
+ return esSetTostringtag;
13693
+ }
13694
+
12599
13695
  var populate;
12600
13696
  var hasRequiredPopulate;
12601
13697
 
12602
13698
  function requirePopulate () {
12603
13699
  if (hasRequiredPopulate) return populate;
12604
13700
  hasRequiredPopulate = 1;
12605
- // populates missing values
12606
- populate = function(dst, src) {
12607
13701
 
12608
- Object.keys(src).forEach(function(prop)
12609
- {
12610
- dst[prop] = dst[prop] || src[prop];
13702
+ // populates missing values
13703
+ populate = function (dst, src) {
13704
+ Object.keys(src).forEach(function (prop) {
13705
+ dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
12611
13706
  });
12612
13707
 
12613
13708
  return dst;
@@ -12621,6 +13716,7 @@ var hasRequiredForm_data;
12621
13716
  function requireForm_data () {
12622
13717
  if (hasRequiredForm_data) return form_data;
12623
13718
  hasRequiredForm_data = 1;
13719
+
12624
13720
  var CombinedStream = requireCombined_stream();
12625
13721
  var util = require$$1;
12626
13722
  var path = require$$1$1;
@@ -12629,23 +13725,20 @@ function requireForm_data () {
12629
13725
  var parseUrl = require$$0$1.parse;
12630
13726
  var fs = require$$6;
12631
13727
  var Stream = stream.Stream;
13728
+ var crypto = require$$8;
12632
13729
  var mime = requireMimeTypes();
12633
13730
  var asynckit = requireAsynckit();
13731
+ var setToStringTag = /*@__PURE__*/ requireEsSetTostringtag();
13732
+ var hasOwn = /*@__PURE__*/ requireHasown();
12634
13733
  var populate = requirePopulate();
12635
13734
 
12636
- // Public API
12637
- form_data = FormData;
12638
-
12639
- // make it a Stream
12640
- util.inherits(FormData, CombinedStream);
12641
-
12642
13735
  /**
12643
13736
  * Create readable "multipart/form-data" streams.
12644
13737
  * Can be used to submit forms
12645
13738
  * and file uploads to other web applications.
12646
13739
  *
12647
13740
  * @constructor
12648
- * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
13741
+ * @param {object} options - Properties to be added/overriden for FormData and CombinedStream
12649
13742
  */
12650
13743
  function FormData(options) {
12651
13744
  if (!(this instanceof FormData)) {
@@ -12658,35 +13751,39 @@ function requireForm_data () {
12658
13751
 
12659
13752
  CombinedStream.call(this);
12660
13753
 
12661
- options = options || {};
12662
- for (var option in options) {
13754
+ options = options || {}; // eslint-disable-line no-param-reassign
13755
+ for (var option in options) { // eslint-disable-line no-restricted-syntax
12663
13756
  this[option] = options[option];
12664
13757
  }
12665
13758
  }
12666
13759
 
13760
+ // make it a Stream
13761
+ util.inherits(FormData, CombinedStream);
13762
+
12667
13763
  FormData.LINE_BREAK = '\r\n';
12668
13764
  FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
12669
13765
 
12670
- FormData.prototype.append = function(field, value, options) {
12671
-
12672
- options = options || {};
13766
+ FormData.prototype.append = function (field, value, options) {
13767
+ options = options || {}; // eslint-disable-line no-param-reassign
12673
13768
 
12674
13769
  // allow filename as single option
12675
- if (typeof options == 'string') {
12676
- options = {filename: options};
13770
+ if (typeof options === 'string') {
13771
+ options = { filename: options }; // eslint-disable-line no-param-reassign
12677
13772
  }
12678
13773
 
12679
13774
  var append = CombinedStream.prototype.append.bind(this);
12680
13775
 
12681
13776
  // all that streamy business can't handle numbers
12682
- if (typeof value == 'number') {
12683
- value = '' + value;
13777
+ if (typeof value === 'number' || value == null) {
13778
+ value = String(value); // eslint-disable-line no-param-reassign
12684
13779
  }
12685
13780
 
12686
13781
  // https://github.com/felixge/node-form-data/issues/38
12687
13782
  if (Array.isArray(value)) {
12688
- // Please convert your array into string
12689
- // the way web server expects it
13783
+ /*
13784
+ * Please convert your array into string
13785
+ * the way web server expects it
13786
+ */
12690
13787
  this._error(new Error('Arrays are not supported.'));
12691
13788
  return;
12692
13789
  }
@@ -12702,15 +13799,17 @@ function requireForm_data () {
12702
13799
  this._trackLength(header, value, options);
12703
13800
  };
12704
13801
 
12705
- FormData.prototype._trackLength = function(header, value, options) {
13802
+ FormData.prototype._trackLength = function (header, value, options) {
12706
13803
  var valueLength = 0;
12707
13804
 
12708
- // used w/ getLengthSync(), when length is known.
12709
- // e.g. for streaming directly from a remote server,
12710
- // w/ a known file a size, and not wanting to wait for
12711
- // incoming file to finish to get its size.
13805
+ /*
13806
+ * used w/ getLengthSync(), when length is known.
13807
+ * e.g. for streaming directly from a remote server,
13808
+ * w/ a known file a size, and not wanting to wait for
13809
+ * incoming file to finish to get its size.
13810
+ */
12712
13811
  if (options.knownLength != null) {
12713
- valueLength += +options.knownLength;
13812
+ valueLength += Number(options.knownLength);
12714
13813
  } else if (Buffer.isBuffer(value)) {
12715
13814
  valueLength = value.length;
12716
13815
  } else if (typeof value === 'string') {
@@ -12720,12 +13819,10 @@ function requireForm_data () {
12720
13819
  this._valueLength += valueLength;
12721
13820
 
12722
13821
  // @check why add CRLF? does this account for custom/multiple CRLFs?
12723
- this._overheadLength +=
12724
- Buffer.byteLength(header) +
12725
- FormData.LINE_BREAK.length;
13822
+ this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
12726
13823
 
12727
13824
  // empty or either doesn't have path or not an http response or not a stream
12728
- if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {
13825
+ if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
12729
13826
  return;
12730
13827
  }
12731
13828
 
@@ -12735,10 +13832,8 @@ function requireForm_data () {
12735
13832
  }
12736
13833
  };
12737
13834
 
12738
- FormData.prototype._lengthRetriever = function(value, callback) {
12739
-
12740
- if (value.hasOwnProperty('fd')) {
12741
-
13835
+ FormData.prototype._lengthRetriever = function (value, callback) {
13836
+ if (hasOwn(value, 'fd')) {
12742
13837
  // take read range into a account
12743
13838
  // `end` = Infinity –> read file till the end
12744
13839
  //
@@ -12747,54 +13842,52 @@ function requireForm_data () {
12747
13842
  // Fix it when node fixes it.
12748
13843
  // https://github.com/joyent/node/issues/7819
12749
13844
  if (value.end != undefined && value.end != Infinity && value.start != undefined) {
12750
-
12751
13845
  // when end specified
12752
13846
  // no need to calculate range
12753
13847
  // inclusive, starts with 0
12754
- callback(null, value.end + 1 - (value.start ? value.start : 0));
13848
+ callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
12755
13849
 
12756
- // not that fast snoopy
13850
+ // not that fast snoopy
12757
13851
  } else {
12758
13852
  // still need to fetch file size from fs
12759
- fs.stat(value.path, function(err, stat) {
12760
-
12761
- var fileSize;
12762
-
13853
+ fs.stat(value.path, function (err, stat) {
12763
13854
  if (err) {
12764
13855
  callback(err);
12765
13856
  return;
12766
13857
  }
12767
13858
 
12768
13859
  // update final size based on the range options
12769
- fileSize = stat.size - (value.start ? value.start : 0);
13860
+ var fileSize = stat.size - (value.start ? value.start : 0);
12770
13861
  callback(null, fileSize);
12771
13862
  });
12772
13863
  }
12773
13864
 
12774
- // or http response
12775
- } else if (value.hasOwnProperty('httpVersion')) {
12776
- callback(null, +value.headers['content-length']);
13865
+ // or http response
13866
+ } else if (hasOwn(value, 'httpVersion')) {
13867
+ callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
12777
13868
 
12778
- // or request stream http://github.com/mikeal/request
12779
- } else if (value.hasOwnProperty('httpModule')) {
13869
+ // or request stream http://github.com/mikeal/request
13870
+ } else if (hasOwn(value, 'httpModule')) {
12780
13871
  // wait till response come back
12781
- value.on('response', function(response) {
13872
+ value.on('response', function (response) {
12782
13873
  value.pause();
12783
- callback(null, +response.headers['content-length']);
13874
+ callback(null, Number(response.headers['content-length']));
12784
13875
  });
12785
13876
  value.resume();
12786
13877
 
12787
- // something else
13878
+ // something else
12788
13879
  } else {
12789
- callback('Unknown stream');
13880
+ callback('Unknown stream'); // eslint-disable-line callback-return
12790
13881
  }
12791
13882
  };
12792
13883
 
12793
- FormData.prototype._multiPartHeader = function(field, value, options) {
12794
- // custom header specified (as string)?
12795
- // it becomes responsible for boundary
12796
- // (e.g. to handle extra CRLFs on .NET servers)
12797
- if (typeof options.header == 'string') {
13884
+ FormData.prototype._multiPartHeader = function (field, value, options) {
13885
+ /*
13886
+ * custom header specified (as string)?
13887
+ * it becomes responsible for boundary
13888
+ * (e.g. to handle extra CRLFs on .NET servers)
13889
+ */
13890
+ if (typeof options.header === 'string') {
12798
13891
  return options.header;
12799
13892
  }
12800
13893
 
@@ -12802,7 +13895,7 @@ function requireForm_data () {
12802
13895
  var contentType = this._getContentType(value, options);
12803
13896
 
12804
13897
  var contents = '';
12805
- var headers = {
13898
+ var headers = {
12806
13899
  // add custom disposition as third element or keep it two elements if not
12807
13900
  'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
12808
13901
  // if no content type. allow it to be empty array
@@ -12810,77 +13903,74 @@ function requireForm_data () {
12810
13903
  };
12811
13904
 
12812
13905
  // allow custom headers.
12813
- if (typeof options.header == 'object') {
13906
+ if (typeof options.header === 'object') {
12814
13907
  populate(headers, options.header);
12815
13908
  }
12816
13909
 
12817
13910
  var header;
12818
- for (var prop in headers) {
12819
- if (!headers.hasOwnProperty(prop)) continue;
12820
- header = headers[prop];
13911
+ for (var prop in headers) { // eslint-disable-line no-restricted-syntax
13912
+ if (hasOwn(headers, prop)) {
13913
+ header = headers[prop];
12821
13914
 
12822
- // skip nullish headers.
12823
- if (header == null) {
12824
- continue;
12825
- }
13915
+ // skip nullish headers.
13916
+ if (header == null) {
13917
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
13918
+ }
12826
13919
 
12827
- // convert all headers to arrays.
12828
- if (!Array.isArray(header)) {
12829
- header = [header];
12830
- }
13920
+ // convert all headers to arrays.
13921
+ if (!Array.isArray(header)) {
13922
+ header = [header];
13923
+ }
12831
13924
 
12832
- // add non-empty headers.
12833
- if (header.length) {
12834
- contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
13925
+ // add non-empty headers.
13926
+ if (header.length) {
13927
+ contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
13928
+ }
12835
13929
  }
12836
13930
  }
12837
13931
 
12838
13932
  return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
12839
13933
  };
12840
13934
 
12841
- FormData.prototype._getContentDisposition = function(value, options) {
12842
-
12843
- var filename
12844
- , contentDisposition
12845
- ;
13935
+ FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
13936
+ var filename;
12846
13937
 
12847
13938
  if (typeof options.filepath === 'string') {
12848
13939
  // custom filepath for relative paths
12849
13940
  filename = path.normalize(options.filepath).replace(/\\/g, '/');
12850
- } else if (options.filename || value.name || value.path) {
12851
- // custom filename take precedence
12852
- // formidable and the browser add a name property
12853
- // fs- and request- streams have path property
12854
- filename = path.basename(options.filename || value.name || value.path);
12855
- } else if (value.readable && value.hasOwnProperty('httpVersion')) {
13941
+ } else if (options.filename || (value && (value.name || value.path))) {
13942
+ /*
13943
+ * custom filename take precedence
13944
+ * formidable and the browser add a name property
13945
+ * fs- and request- streams have path property
13946
+ */
13947
+ filename = path.basename(options.filename || (value && (value.name || value.path)));
13948
+ } else if (value && value.readable && hasOwn(value, 'httpVersion')) {
12856
13949
  // or try http response
12857
13950
  filename = path.basename(value.client._httpMessage.path || '');
12858
13951
  }
12859
13952
 
12860
13953
  if (filename) {
12861
- contentDisposition = 'filename="' + filename + '"';
13954
+ return 'filename="' + filename + '"';
12862
13955
  }
12863
-
12864
- return contentDisposition;
12865
13956
  };
12866
13957
 
12867
- FormData.prototype._getContentType = function(value, options) {
12868
-
13958
+ FormData.prototype._getContentType = function (value, options) {
12869
13959
  // use custom content-type above all
12870
13960
  var contentType = options.contentType;
12871
13961
 
12872
13962
  // or try `name` from formidable, browser
12873
- if (!contentType && value.name) {
13963
+ if (!contentType && value && value.name) {
12874
13964
  contentType = mime.lookup(value.name);
12875
13965
  }
12876
13966
 
12877
13967
  // or try `path` from fs-, request- streams
12878
- if (!contentType && value.path) {
13968
+ if (!contentType && value && value.path) {
12879
13969
  contentType = mime.lookup(value.path);
12880
13970
  }
12881
13971
 
12882
13972
  // or if it's http-reponse
12883
- if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
13973
+ if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
12884
13974
  contentType = value.headers['content-type'];
12885
13975
  }
12886
13976
 
@@ -12890,18 +13980,18 @@ function requireForm_data () {
12890
13980
  }
12891
13981
 
12892
13982
  // fallback to the default content type if `value` is not simple value
12893
- if (!contentType && typeof value == 'object') {
13983
+ if (!contentType && value && typeof value === 'object') {
12894
13984
  contentType = FormData.DEFAULT_CONTENT_TYPE;
12895
13985
  }
12896
13986
 
12897
13987
  return contentType;
12898
13988
  };
12899
13989
 
12900
- FormData.prototype._multiPartFooter = function() {
12901
- return function(next) {
13990
+ FormData.prototype._multiPartFooter = function () {
13991
+ return function (next) {
12902
13992
  var footer = FormData.LINE_BREAK;
12903
13993
 
12904
- var lastPart = (this._streams.length === 0);
13994
+ var lastPart = this._streams.length === 0;
12905
13995
  if (lastPart) {
12906
13996
  footer += this._lastBoundary();
12907
13997
  }
@@ -12910,18 +14000,18 @@ function requireForm_data () {
12910
14000
  }.bind(this);
12911
14001
  };
12912
14002
 
12913
- FormData.prototype._lastBoundary = function() {
14003
+ FormData.prototype._lastBoundary = function () {
12914
14004
  return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
12915
14005
  };
12916
14006
 
12917
- FormData.prototype.getHeaders = function(userHeaders) {
14007
+ FormData.prototype.getHeaders = function (userHeaders) {
12918
14008
  var header;
12919
14009
  var formHeaders = {
12920
14010
  'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
12921
14011
  };
12922
14012
 
12923
- for (header in userHeaders) {
12924
- if (userHeaders.hasOwnProperty(header)) {
14013
+ for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
14014
+ if (hasOwn(userHeaders, header)) {
12925
14015
  formHeaders[header.toLowerCase()] = userHeaders[header];
12926
14016
  }
12927
14017
  }
@@ -12929,11 +14019,14 @@ function requireForm_data () {
12929
14019
  return formHeaders;
12930
14020
  };
12931
14021
 
12932
- FormData.prototype.setBoundary = function(boundary) {
14022
+ FormData.prototype.setBoundary = function (boundary) {
14023
+ if (typeof boundary !== 'string') {
14024
+ throw new TypeError('FormData boundary must be a string');
14025
+ }
12933
14026
  this._boundary = boundary;
12934
14027
  };
12935
14028
 
12936
- FormData.prototype.getBoundary = function() {
14029
+ FormData.prototype.getBoundary = function () {
12937
14030
  if (!this._boundary) {
12938
14031
  this._generateBoundary();
12939
14032
  }
@@ -12941,60 +14034,55 @@ function requireForm_data () {
12941
14034
  return this._boundary;
12942
14035
  };
12943
14036
 
12944
- FormData.prototype.getBuffer = function() {
12945
- var dataBuffer = new Buffer.alloc( 0 );
14037
+ FormData.prototype.getBuffer = function () {
14038
+ var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
12946
14039
  var boundary = this.getBoundary();
12947
14040
 
12948
14041
  // Create the form content. Add Line breaks to the end of data.
12949
14042
  for (var i = 0, len = this._streams.length; i < len; i++) {
12950
14043
  if (typeof this._streams[i] !== 'function') {
12951
-
12952
14044
  // Add content to the buffer.
12953
- if(Buffer.isBuffer(this._streams[i])) {
12954
- dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);
12955
- }else {
12956
- dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);
14045
+ if (Buffer.isBuffer(this._streams[i])) {
14046
+ dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
14047
+ } else {
14048
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
12957
14049
  }
12958
14050
 
12959
14051
  // Add break after content.
12960
- if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {
12961
- dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );
14052
+ if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
14053
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
12962
14054
  }
12963
14055
  }
12964
14056
  }
12965
14057
 
12966
14058
  // Add the footer and return the Buffer object.
12967
- return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );
14059
+ return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
12968
14060
  };
12969
14061
 
12970
- FormData.prototype._generateBoundary = function() {
14062
+ FormData.prototype._generateBoundary = function () {
12971
14063
  // This generates a 50 character boundary similar to those used by Firefox.
12972
- // They are optimized for boyer-moore parsing.
12973
- var boundary = '--------------------------';
12974
- for (var i = 0; i < 24; i++) {
12975
- boundary += Math.floor(Math.random() * 10).toString(16);
12976
- }
12977
14064
 
12978
- this._boundary = boundary;
14065
+ // They are optimized for boyer-moore parsing.
14066
+ this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
12979
14067
  };
12980
14068
 
12981
14069
  // Note: getLengthSync DOESN'T calculate streams length
12982
- // As workaround one can calculate file size manually
12983
- // and add it as knownLength option
12984
- FormData.prototype.getLengthSync = function() {
14070
+ // As workaround one can calculate file size manually and add it as knownLength option
14071
+ FormData.prototype.getLengthSync = function () {
12985
14072
  var knownLength = this._overheadLength + this._valueLength;
12986
14073
 
12987
- // Don't get confused, there are 3 "internal" streams for each keyval pair
12988
- // so it basically checks if there is any value added to the form
14074
+ // Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
12989
14075
  if (this._streams.length) {
12990
14076
  knownLength += this._lastBoundary().length;
12991
14077
  }
12992
14078
 
12993
14079
  // https://github.com/form-data/form-data/issues/40
12994
14080
  if (!this.hasKnownLength()) {
12995
- // Some async length retrievers are present
12996
- // therefore synchronous length calculation is false.
12997
- // Please use getLength(callback) to get proper length
14081
+ /*
14082
+ * Some async length retrievers are present
14083
+ * therefore synchronous length calculation is false.
14084
+ * Please use getLength(callback) to get proper length
14085
+ */
12998
14086
  this._error(new Error('Cannot calculate proper length in synchronous way.'));
12999
14087
  }
13000
14088
 
@@ -13004,7 +14092,7 @@ function requireForm_data () {
13004
14092
  // Public API to check if length of added values is known
13005
14093
  // https://github.com/form-data/form-data/issues/196
13006
14094
  // https://github.com/form-data/form-data/issues/262
13007
- FormData.prototype.hasKnownLength = function() {
14095
+ FormData.prototype.hasKnownLength = function () {
13008
14096
  var hasKnownLength = true;
13009
14097
 
13010
14098
  if (this._valuesToMeasure.length) {
@@ -13014,7 +14102,7 @@ function requireForm_data () {
13014
14102
  return hasKnownLength;
13015
14103
  };
13016
14104
 
13017
- FormData.prototype.getLength = function(cb) {
14105
+ FormData.prototype.getLength = function (cb) {
13018
14106
  var knownLength = this._overheadLength + this._valueLength;
13019
14107
 
13020
14108
  if (this._streams.length) {
@@ -13026,13 +14114,13 @@ function requireForm_data () {
13026
14114
  return;
13027
14115
  }
13028
14116
 
13029
- asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
14117
+ asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
13030
14118
  if (err) {
13031
14119
  cb(err);
13032
14120
  return;
13033
14121
  }
13034
14122
 
13035
- values.forEach(function(length) {
14123
+ values.forEach(function (length) {
13036
14124
  knownLength += length;
13037
14125
  });
13038
14126
 
@@ -13040,31 +14128,26 @@ function requireForm_data () {
13040
14128
  });
13041
14129
  };
13042
14130
 
13043
- FormData.prototype.submit = function(params, cb) {
13044
- var request
13045
- , options
13046
- , defaults = {method: 'post'}
13047
- ;
13048
-
13049
- // parse provided url if it's string
13050
- // or treat it as options object
13051
- if (typeof params == 'string') {
14131
+ FormData.prototype.submit = function (params, cb) {
14132
+ var request;
14133
+ var options;
14134
+ var defaults = { method: 'post' };
13052
14135
 
13053
- params = parseUrl(params);
14136
+ // parse provided url if it's string or treat it as options object
14137
+ if (typeof params === 'string') {
14138
+ params = parseUrl(params); // eslint-disable-line no-param-reassign
14139
+ /* eslint sort-keys: 0 */
13054
14140
  options = populate({
13055
14141
  port: params.port,
13056
14142
  path: params.pathname,
13057
14143
  host: params.hostname,
13058
14144
  protocol: params.protocol
13059
14145
  }, defaults);
13060
-
13061
- // use custom params
13062
- } else {
13063
-
14146
+ } else { // use custom params
13064
14147
  options = populate(params, defaults);
13065
14148
  // if no port provided use default one
13066
14149
  if (!options.port) {
13067
- options.port = options.protocol == 'https:' ? 443 : 80;
14150
+ options.port = options.protocol === 'https:' ? 443 : 80;
13068
14151
  }
13069
14152
  }
13070
14153
 
@@ -13072,14 +14155,14 @@ function requireForm_data () {
13072
14155
  options.headers = this.getHeaders(params.headers);
13073
14156
 
13074
14157
  // https if specified, fallback to http in any other case
13075
- if (options.protocol == 'https:') {
14158
+ if (options.protocol === 'https:') {
13076
14159
  request = https.request(options);
13077
14160
  } else {
13078
14161
  request = http.request(options);
13079
14162
  }
13080
14163
 
13081
14164
  // get content length and fire away
13082
- this.getLength(function(err, length) {
14165
+ this.getLength(function (err, length) {
13083
14166
  if (err && err !== 'Unknown stream') {
13084
14167
  this._error(err);
13085
14168
  return;
@@ -13098,7 +14181,7 @@ function requireForm_data () {
13098
14181
  request.removeListener('error', callback);
13099
14182
  request.removeListener('response', onResponse);
13100
14183
 
13101
- return cb.call(this, error, responce);
14184
+ return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
13102
14185
  };
13103
14186
 
13104
14187
  onResponse = callback.bind(this, null);
@@ -13111,7 +14194,7 @@ function requireForm_data () {
13111
14194
  return request;
13112
14195
  };
13113
14196
 
13114
- FormData.prototype._error = function(err) {
14197
+ FormData.prototype._error = function (err) {
13115
14198
  if (!this.error) {
13116
14199
  this.error = err;
13117
14200
  this.pause();
@@ -13122,6 +14205,10 @@ function requireForm_data () {
13122
14205
  FormData.prototype.toString = function () {
13123
14206
  return '[object FormData]';
13124
14207
  };
14208
+ setToStringTag(FormData, 'FormData');
14209
+
14210
+ // Public API
14211
+ form_data = FormData;
13125
14212
  return form_data;
13126
14213
  }
13127
14214
 
@@ -13206,7 +14293,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
13206
14293
  *
13207
14294
  * @returns
13208
14295
  */
13209
- function toFormData(obj, formData, options) {
14296
+ function toFormData$1(obj, formData, options) {
13210
14297
  if (!utils$1.isObject(obj)) {
13211
14298
  throw new TypeError('target must be an object');
13212
14299
  }
@@ -13243,8 +14330,12 @@ function toFormData(obj, formData, options) {
13243
14330
  return value.toISOString();
13244
14331
  }
13245
14332
 
14333
+ if (utils$1.isBoolean(value)) {
14334
+ return value.toString();
14335
+ }
14336
+
13246
14337
  if (!useBlob && utils$1.isBlob(value)) {
13247
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
14338
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
13248
14339
  }
13249
14340
 
13250
14341
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -13373,7 +14464,7 @@ function encode$1(str) {
13373
14464
  function AxiosURLSearchParams(params, options) {
13374
14465
  this._pairs = [];
13375
14466
 
13376
- params && toFormData(params, this, options);
14467
+ params && toFormData$1(params, this, options);
13377
14468
  }
13378
14469
 
13379
14470
  const prototype = AxiosURLSearchParams.prototype;
@@ -13531,6 +14622,29 @@ var transitionalDefaults = {
13531
14622
 
13532
14623
  var URLSearchParams = require$$0$1.URLSearchParams;
13533
14624
 
14625
+ const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
14626
+
14627
+ const DIGIT = '0123456789';
14628
+
14629
+ const ALPHABET = {
14630
+ DIGIT,
14631
+ ALPHA,
14632
+ ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
14633
+ };
14634
+
14635
+ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
14636
+ let str = '';
14637
+ const {length} = alphabet;
14638
+ const randomValues = new Uint32Array(size);
14639
+ require$$8.randomFillSync(randomValues);
14640
+ for (let i = 0; i < size; i++) {
14641
+ str += alphabet[randomValues[i] % length];
14642
+ }
14643
+
14644
+ return str;
14645
+ };
14646
+
14647
+
13534
14648
  var platform$1 = {
13535
14649
  isNode: true,
13536
14650
  classes: {
@@ -13538,6 +14652,8 @@ var platform$1 = {
13538
14652
  FormData: FormData$1,
13539
14653
  Blob: typeof Blob !== 'undefined' && Blob || null
13540
14654
  },
14655
+ ALPHABET,
14656
+ generateString,
13541
14657
  protocols: [ 'http', 'https', 'file', 'data' ]
13542
14658
  };
13543
14659
 
@@ -13600,7 +14716,7 @@ var platform = {
13600
14716
  };
13601
14717
 
13602
14718
  function toURLEncodedForm(data, options) {
13603
- return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
14719
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
13604
14720
  visitor: function(value, key, path, helpers) {
13605
14721
  if (platform.isNode && utils$1.isBuffer(value)) {
13606
14722
  this.append(key, value.toString('base64'));
@@ -13608,8 +14724,9 @@ function toURLEncodedForm(data, options) {
13608
14724
  }
13609
14725
 
13610
14726
  return helpers.defaultVisitor.apply(this, arguments);
13611
- }
13612
- }, options));
14727
+ },
14728
+ ...options
14729
+ });
13613
14730
  }
13614
14731
 
13615
14732
  /**
@@ -13724,7 +14841,7 @@ function stringifySafely(rawValue, parser, encoder) {
13724
14841
  }
13725
14842
  }
13726
14843
 
13727
- return (0, JSON.stringify)(rawValue);
14844
+ return (encoder || JSON.stringify)(rawValue);
13728
14845
  }
13729
14846
 
13730
14847
  const defaults = {
@@ -13775,7 +14892,7 @@ const defaults = {
13775
14892
  if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
13776
14893
  const _FormData = this.env && this.env.FormData;
13777
14894
 
13778
- return toFormData(
14895
+ return toFormData$1(
13779
14896
  isFileList ? {'files[]': data} : data,
13780
14897
  _FormData && new _FormData(),
13781
14898
  this.formSerializer
@@ -13809,7 +14926,7 @@ const defaults = {
13809
14926
  } catch (e) {
13810
14927
  if (strictJSONParsing) {
13811
14928
  if (e.name === 'SyntaxError') {
13812
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
14929
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
13813
14930
  }
13814
14931
  throw e;
13815
14932
  }
@@ -13972,7 +15089,7 @@ function buildAccessors(obj, header) {
13972
15089
  });
13973
15090
  }
13974
15091
 
13975
- class AxiosHeaders {
15092
+ let AxiosHeaders$1 = class AxiosHeaders {
13976
15093
  constructor(headers) {
13977
15094
  headers && this.set(headers);
13978
15095
  }
@@ -14001,10 +15118,18 @@ class AxiosHeaders {
14001
15118
  setHeaders(header, valueOrRewrite);
14002
15119
  } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
14003
15120
  setHeaders(parseHeaders(header), valueOrRewrite);
14004
- } else if (utils$1.isHeaders(header)) {
14005
- for (const [key, value] of header.entries()) {
14006
- setHeader(value, key, rewrite);
15121
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15122
+ let obj = {}, dest, key;
15123
+ for (const entry of header) {
15124
+ if (!utils$1.isArray(entry)) {
15125
+ throw TypeError('Object iterator must return a key-value pair');
15126
+ }
15127
+
15128
+ obj[key = entry[0]] = (dest = obj[key]) ?
15129
+ (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
14007
15130
  }
15131
+
15132
+ setHeaders(obj, valueOrRewrite);
14008
15133
  } else {
14009
15134
  header != null && setHeader(valueOrRewrite, header, rewrite);
14010
15135
  }
@@ -14146,6 +15271,10 @@ class AxiosHeaders {
14146
15271
  return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
14147
15272
  }
14148
15273
 
15274
+ getSetCookie() {
15275
+ return this.get("set-cookie") || [];
15276
+ }
15277
+
14149
15278
  get [Symbol.toStringTag]() {
14150
15279
  return 'AxiosHeaders';
14151
15280
  }
@@ -14183,12 +15312,12 @@ class AxiosHeaders {
14183
15312
 
14184
15313
  return this;
14185
15314
  }
14186
- }
15315
+ };
14187
15316
 
14188
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
15317
+ AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
14189
15318
 
14190
15319
  // reserved names hotfix
14191
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
15320
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
14192
15321
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
14193
15322
  return {
14194
15323
  get: () => value,
@@ -14198,7 +15327,7 @@ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
14198
15327
  }
14199
15328
  });
14200
15329
 
14201
- utils$1.freezeMethods(AxiosHeaders);
15330
+ utils$1.freezeMethods(AxiosHeaders$1);
14202
15331
 
14203
15332
  /**
14204
15333
  * Transform the data for a request or a response
@@ -14211,7 +15340,7 @@ utils$1.freezeMethods(AxiosHeaders);
14211
15340
  function transformData(fns, response) {
14212
15341
  const config = this || defaults;
14213
15342
  const context = response || config;
14214
- const headers = AxiosHeaders.from(context.headers);
15343
+ const headers = AxiosHeaders$1.from(context.headers);
14215
15344
  let data = context.data;
14216
15345
 
14217
15346
  utils$1.forEach(fns, function transform(fn) {
@@ -14223,7 +15352,7 @@ function transformData(fns, response) {
14223
15352
  return data;
14224
15353
  }
14225
15354
 
14226
- function isCancel(value) {
15355
+ function isCancel$1(value) {
14227
15356
  return !!(value && value.__CANCEL__);
14228
15357
  }
14229
15358
 
@@ -14236,13 +15365,13 @@ function isCancel(value) {
14236
15365
  *
14237
15366
  * @returns {CanceledError} The created error.
14238
15367
  */
14239
- function CanceledError(message, config, request) {
15368
+ function CanceledError$1(message, config, request) {
14240
15369
  // eslint-disable-next-line no-eq-null,eqeqeq
14241
- AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
15370
+ AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
14242
15371
  this.name = 'CanceledError';
14243
15372
  }
14244
15373
 
14245
- utils$1.inherits(CanceledError, AxiosError, {
15374
+ utils$1.inherits(CanceledError$1, AxiosError$1, {
14246
15375
  __CANCEL__: true
14247
15376
  });
14248
15377
 
@@ -14260,9 +15389,9 @@ function settle(resolve, reject, response) {
14260
15389
  if (!response.status || !validateStatus || validateStatus(response.status)) {
14261
15390
  resolve(response);
14262
15391
  } else {
14263
- reject(new AxiosError(
15392
+ reject(new AxiosError$1(
14264
15393
  'Request failed with status code ' + response.status,
14265
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
15394
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
14266
15395
  response.config,
14267
15396
  response.request,
14268
15397
  response
@@ -14308,8 +15437,9 @@ function combineURLs(baseURL, relativeURL) {
14308
15437
  *
14309
15438
  * @returns {string} The combined full path
14310
15439
  */
14311
- function buildFullPath(baseURL, requestedURL) {
14312
- if (baseURL && !isAbsoluteURL(requestedURL)) {
15440
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
15441
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
15442
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
14313
15443
  return combineURLs(baseURL, requestedURL);
14314
15444
  }
14315
15445
  return requestedURL;
@@ -15158,7 +16288,7 @@ function requireFollowRedirects () {
15158
16288
  var followRedirectsExports = requireFollowRedirects();
15159
16289
  var followRedirects = /*@__PURE__*/getDefaultExportFromCjs(followRedirectsExports);
15160
16290
 
15161
- const VERSION = "1.7.9";
16291
+ const VERSION$1 = "1.11.0";
15162
16292
 
15163
16293
  function parseProtocol(url) {
15164
16294
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -15178,7 +16308,7 @@ const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
15178
16308
  * @returns {Buffer|Blob}
15179
16309
  */
15180
16310
  function fromDataURI(uri, asBlob, options) {
15181
- const _Blob = options.Blob || platform.classes.Blob;
16311
+ const _Blob = options && options.Blob || platform.classes.Blob;
15182
16312
  const protocol = parseProtocol(uri);
15183
16313
 
15184
16314
  if (asBlob === undefined && _Blob) {
@@ -15191,7 +16321,7 @@ function fromDataURI(uri, asBlob, options) {
15191
16321
  const match = DATA_URL_PATTERN.exec(uri);
15192
16322
 
15193
16323
  if (!match) {
15194
- throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
16324
+ throw new AxiosError$1('Invalid URL', AxiosError$1.ERR_INVALID_URL);
15195
16325
  }
15196
16326
 
15197
16327
  const mime = match[1];
@@ -15201,7 +16331,7 @@ function fromDataURI(uri, asBlob, options) {
15201
16331
 
15202
16332
  if (asBlob) {
15203
16333
  if (!_Blob) {
15204
- throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
16334
+ throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT);
15205
16335
  }
15206
16336
 
15207
16337
  return new _Blob([buffer], {type: mime});
@@ -15210,7 +16340,7 @@ function fromDataURI(uri, asBlob, options) {
15210
16340
  return buffer;
15211
16341
  }
15212
16342
 
15213
- throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
16343
+ throw new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_NOT_SUPPORT);
15214
16344
  }
15215
16345
 
15216
16346
  const kInternals = Symbol('internals');
@@ -15364,7 +16494,7 @@ const readBlob = async function* (blob) {
15364
16494
  }
15365
16495
  };
15366
16496
 
15367
- const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
16497
+ const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
15368
16498
 
15369
16499
  const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new require$$1.TextEncoder();
15370
16500
 
@@ -15424,8 +16554,8 @@ const formDataToStream = (form, headersHandler, options) => {
15424
16554
  const {
15425
16555
  tag = 'form-data-boundary',
15426
16556
  size = 25,
15427
- boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
15428
- } = options;
16557
+ boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
16558
+ } = options || {};
15429
16559
 
15430
16560
  if(!utils$1.isFormData(form)) {
15431
16561
  throw TypeError('FormData instance required');
@@ -15436,7 +16566,7 @@ const formDataToStream = (form, headersHandler, options) => {
15436
16566
  }
15437
16567
 
15438
16568
  const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
15439
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
16569
+ const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
15440
16570
  let contentLength = footerBytes.byteLength;
15441
16571
 
15442
16572
  const parts = Array.from(form.entries()).map(([name, value]) => {
@@ -15457,7 +16587,7 @@ const formDataToStream = (form, headersHandler, options) => {
15457
16587
  computedHeaders['Content-Length'] = contentLength;
15458
16588
  }
15459
16589
 
15460
- headersHandler(computedHeaders);
16590
+ headersHandler && headersHandler(computedHeaders);
15461
16591
 
15462
16592
  return stream.Readable.from((async function *() {
15463
16593
  for(const part of parts) {
@@ -15576,7 +16706,7 @@ function throttle(fn, freq) {
15576
16706
  clearTimeout(timer);
15577
16707
  timer = null;
15578
16708
  }
15579
- fn.apply(null, args);
16709
+ fn(...args);
15580
16710
  };
15581
16711
 
15582
16712
  const throttled = (...args) => {
@@ -15830,7 +16960,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15830
16960
  });
15831
16961
 
15832
16962
  function abort(reason) {
15833
- emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
16963
+ emitter.emit('abort', !reason || reason.type ? new CanceledError$1(null, config, req) : reason);
15834
16964
  }
15835
16965
 
15836
16966
  emitter.once('abort', reject);
@@ -15843,7 +16973,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15843
16973
  }
15844
16974
 
15845
16975
  // Parse url
15846
- const fullPath = buildFullPath(config.baseURL, config.url);
16976
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
15847
16977
  const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
15848
16978
  const protocol = parsed.protocol || supportedProtocols[0];
15849
16979
 
@@ -15864,7 +16994,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15864
16994
  Blob: config.env && config.env.Blob
15865
16995
  });
15866
16996
  } catch (err) {
15867
- throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
16997
+ throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
15868
16998
  }
15869
16999
 
15870
17000
  if (responseType === 'text') {
@@ -15881,26 +17011,26 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15881
17011
  data: convertedData,
15882
17012
  status: 200,
15883
17013
  statusText: 'OK',
15884
- headers: new AxiosHeaders(),
17014
+ headers: new AxiosHeaders$1(),
15885
17015
  config
15886
17016
  });
15887
17017
  }
15888
17018
 
15889
17019
  if (supportedProtocols.indexOf(protocol) === -1) {
15890
- return reject(new AxiosError(
17020
+ return reject(new AxiosError$1(
15891
17021
  'Unsupported protocol ' + protocol,
15892
- AxiosError.ERR_BAD_REQUEST,
17022
+ AxiosError$1.ERR_BAD_REQUEST,
15893
17023
  config
15894
17024
  ));
15895
17025
  }
15896
17026
 
15897
- const headers = AxiosHeaders.from(config.headers).normalize();
17027
+ const headers = AxiosHeaders$1.from(config.headers).normalize();
15898
17028
 
15899
17029
  // Set User-Agent (required by some servers)
15900
17030
  // See https://github.com/axios/axios/issues/69
15901
17031
  // User-Agent is specified; handle case where no UA header is desired
15902
17032
  // Only set header if it hasn't been set in config
15903
- headers.set('User-Agent', 'axios/' + VERSION, false);
17033
+ headers.set('User-Agent', 'axios/' + VERSION$1, false);
15904
17034
 
15905
17035
  const {onUploadProgress, onDownloadProgress} = config;
15906
17036
  const maxRate = config.maxRate;
@@ -15914,7 +17044,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15914
17044
  data = formDataToStream(data, (formHeaders) => {
15915
17045
  headers.set(formHeaders);
15916
17046
  }, {
15917
- tag: `axios-${VERSION}-boundary`,
17047
+ tag: `axios-${VERSION$1}-boundary`,
15918
17048
  boundary: userBoundary && userBoundary[1] || undefined
15919
17049
  });
15920
17050
  // support for https://www.npmjs.com/package/form-data api
@@ -15939,9 +17069,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15939
17069
  } else if (utils$1.isString(data)) {
15940
17070
  data = Buffer.from(data, 'utf-8');
15941
17071
  } else {
15942
- return reject(new AxiosError(
17072
+ return reject(new AxiosError$1(
15943
17073
  'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
15944
- AxiosError.ERR_BAD_REQUEST,
17074
+ AxiosError$1.ERR_BAD_REQUEST,
15945
17075
  config
15946
17076
  ));
15947
17077
  }
@@ -15950,9 +17080,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
15950
17080
  headers.setContentLength(data.length, false);
15951
17081
 
15952
17082
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
15953
- return reject(new AxiosError(
17083
+ return reject(new AxiosError$1(
15954
17084
  'Request body larger than maxBodyLength limit',
15955
- AxiosError.ERR_BAD_REQUEST,
17085
+ AxiosError$1.ERR_BAD_REQUEST,
15956
17086
  config
15957
17087
  ));
15958
17088
  }
@@ -16150,7 +17280,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16150
17280
  const response = {
16151
17281
  status: res.statusCode,
16152
17282
  statusText: res.statusMessage,
16153
- headers: new AxiosHeaders(res.headers),
17283
+ headers: new AxiosHeaders$1(res.headers),
16154
17284
  config,
16155
17285
  request: lastRequest
16156
17286
  };
@@ -16171,8 +17301,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16171
17301
  // stream.destroy() emit aborted event before calling reject() on Node.js v16
16172
17302
  rejected = true;
16173
17303
  responseStream.destroy();
16174
- reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
16175
- AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
17304
+ reject(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded',
17305
+ AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
16176
17306
  }
16177
17307
  });
16178
17308
 
@@ -16181,9 +17311,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16181
17311
  return;
16182
17312
  }
16183
17313
 
16184
- const err = new AxiosError(
17314
+ const err = new AxiosError$1(
16185
17315
  'stream has been aborted',
16186
- AxiosError.ERR_BAD_RESPONSE,
17316
+ AxiosError$1.ERR_BAD_RESPONSE,
16187
17317
  config,
16188
17318
  lastRequest
16189
17319
  );
@@ -16193,7 +17323,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16193
17323
 
16194
17324
  responseStream.on('error', function handleStreamError(err) {
16195
17325
  if (req.destroyed) return;
16196
- reject(AxiosError.from(err, null, config, lastRequest));
17326
+ reject(AxiosError$1.from(err, null, config, lastRequest));
16197
17327
  });
16198
17328
 
16199
17329
  responseStream.on('end', function handleStreamEnd() {
@@ -16207,7 +17337,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16207
17337
  }
16208
17338
  response.data = responseData;
16209
17339
  } catch (err) {
16210
- return reject(AxiosError.from(err, null, config, response.request, response));
17340
+ return reject(AxiosError$1.from(err, null, config, response.request, response));
16211
17341
  }
16212
17342
  settle(resolve, reject, response);
16213
17343
  });
@@ -16230,7 +17360,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16230
17360
  req.on('error', function handleRequestError(err) {
16231
17361
  // @todo remove
16232
17362
  // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
16233
- reject(AxiosError.from(err, null, config, req));
17363
+ reject(AxiosError$1.from(err, null, config, req));
16234
17364
  });
16235
17365
 
16236
17366
  // set tcp keep alive to prevent drop connection by peer
@@ -16245,9 +17375,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16245
17375
  const timeout = parseInt(config.timeout, 10);
16246
17376
 
16247
17377
  if (Number.isNaN(timeout)) {
16248
- reject(new AxiosError(
17378
+ reject(new AxiosError$1(
16249
17379
  'error trying to parse `config.timeout` to int',
16250
- AxiosError.ERR_BAD_OPTION_VALUE,
17380
+ AxiosError$1.ERR_BAD_OPTION_VALUE,
16251
17381
  config,
16252
17382
  req
16253
17383
  ));
@@ -16267,9 +17397,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16267
17397
  if (config.timeoutErrorMessage) {
16268
17398
  timeoutErrorMessage = config.timeoutErrorMessage;
16269
17399
  }
16270
- reject(new AxiosError(
17400
+ reject(new AxiosError$1(
16271
17401
  timeoutErrorMessage,
16272
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
17402
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
16273
17403
  config,
16274
17404
  req
16275
17405
  ));
@@ -16294,7 +17424,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
16294
17424
 
16295
17425
  data.on('close', () => {
16296
17426
  if (!ended && !errored) {
16297
- abort(new CanceledError('Request stream has been aborted', config, req));
17427
+ abort(new CanceledError$1('Request stream has been aborted', config, req));
16298
17428
  }
16299
17429
  });
16300
17430
 
@@ -16357,7 +17487,7 @@ var cookies = platform.hasStandardBrowserEnv ?
16357
17487
  remove() {}
16358
17488
  };
16359
17489
 
16360
- const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
17490
+ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
16361
17491
 
16362
17492
  /**
16363
17493
  * Config-specific merge-function which creates a new config-object
@@ -16368,7 +17498,7 @@ const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing }
16368
17498
  *
16369
17499
  * @returns {Object} New object resulting from merging config2 to config1
16370
17500
  */
16371
- function mergeConfig(config1, config2) {
17501
+ function mergeConfig$1(config1, config2) {
16372
17502
  // eslint-disable-next-line no-param-reassign
16373
17503
  config2 = config2 || {};
16374
17504
  const config = {};
@@ -16450,7 +17580,7 @@ function mergeConfig(config1, config2) {
16450
17580
  headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
16451
17581
  };
16452
17582
 
16453
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
17583
+ utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
16454
17584
  const merge = mergeMap[prop] || mergeDeepProperties;
16455
17585
  const configValue = merge(config1[prop], config2[prop], prop);
16456
17586
  (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -16460,13 +17590,13 @@ function mergeConfig(config1, config2) {
16460
17590
  }
16461
17591
 
16462
17592
  var resolveConfig = (config) => {
16463
- const newConfig = mergeConfig({}, config);
17593
+ const newConfig = mergeConfig$1({}, config);
16464
17594
 
16465
17595
  let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
16466
17596
 
16467
- newConfig.headers = headers = AxiosHeaders.from(headers);
17597
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
16468
17598
 
16469
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
17599
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
16470
17600
 
16471
17601
  // HTTP basic authentication
16472
17602
  if (auth) {
@@ -16513,7 +17643,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16513
17643
  return new Promise(function dispatchXhrRequest(resolve, reject) {
16514
17644
  const _config = resolveConfig(config);
16515
17645
  let requestData = _config.data;
16516
- const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
17646
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
16517
17647
  let {responseType, onUploadProgress, onDownloadProgress} = _config;
16518
17648
  let onCanceled;
16519
17649
  let uploadThrottled, downloadThrottled;
@@ -16540,7 +17670,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16540
17670
  return;
16541
17671
  }
16542
17672
  // Prepare the response
16543
- const responseHeaders = AxiosHeaders.from(
17673
+ const responseHeaders = AxiosHeaders$1.from(
16544
17674
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
16545
17675
  );
16546
17676
  const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
@@ -16595,7 +17725,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16595
17725
  return;
16596
17726
  }
16597
17727
 
16598
- reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
17728
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
16599
17729
 
16600
17730
  // Clean up request
16601
17731
  request = null;
@@ -16605,7 +17735,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16605
17735
  request.onerror = function handleError() {
16606
17736
  // Real errors are hidden from us by the browser
16607
17737
  // onerror should only fire if it's a network error
16608
- reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
17738
+ reject(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request));
16609
17739
 
16610
17740
  // Clean up request
16611
17741
  request = null;
@@ -16618,9 +17748,9 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16618
17748
  if (_config.timeoutErrorMessage) {
16619
17749
  timeoutErrorMessage = _config.timeoutErrorMessage;
16620
17750
  }
16621
- reject(new AxiosError(
17751
+ reject(new AxiosError$1(
16622
17752
  timeoutErrorMessage,
16623
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
17753
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
16624
17754
  config,
16625
17755
  request));
16626
17756
 
@@ -16670,7 +17800,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16670
17800
  if (!request) {
16671
17801
  return;
16672
17802
  }
16673
- reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
17803
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
16674
17804
  request.abort();
16675
17805
  request = null;
16676
17806
  };
@@ -16684,7 +17814,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
16684
17814
  const protocol = parseProtocol(_config.url);
16685
17815
 
16686
17816
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
16687
- reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
17817
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
16688
17818
  return;
16689
17819
  }
16690
17820
 
@@ -16707,13 +17837,13 @@ const composeSignals = (signals, timeout) => {
16707
17837
  aborted = true;
16708
17838
  unsubscribe();
16709
17839
  const err = reason instanceof Error ? reason : this.reason;
16710
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
17840
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
16711
17841
  }
16712
17842
  };
16713
17843
 
16714
17844
  let timer = timeout && setTimeout(() => {
16715
17845
  timer = null;
16716
- onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
17846
+ onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
16717
17847
  }, timeout);
16718
17848
 
16719
17849
  const unsubscribe = () => {
@@ -16870,7 +18000,7 @@ isFetchSupported && (((res) => {
16870
18000
  ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
16871
18001
  !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
16872
18002
  (_, config) => {
16873
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
18003
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
16874
18004
  });
16875
18005
  });
16876
18006
  })(new Response));
@@ -16983,7 +18113,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
16983
18113
  credentials: isCredentialsSupported ? withCredentials : undefined
16984
18114
  });
16985
18115
 
16986
- let response = await fetch(request);
18116
+ let response = await fetch(request, fetchOptions);
16987
18117
 
16988
18118
  const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
16989
18119
 
@@ -17019,7 +18149,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
17019
18149
  return await new Promise((resolve, reject) => {
17020
18150
  settle(resolve, reject, {
17021
18151
  data: responseData,
17022
- headers: AxiosHeaders.from(response.headers),
18152
+ headers: AxiosHeaders$1.from(response.headers),
17023
18153
  status: response.status,
17024
18154
  statusText: response.statusText,
17025
18155
  config,
@@ -17029,16 +18159,16 @@ var fetchAdapter = isFetchSupported && (async (config) => {
17029
18159
  } catch (err) {
17030
18160
  unsubscribe && unsubscribe();
17031
18161
 
17032
- if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
18162
+ if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
17033
18163
  throw Object.assign(
17034
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
18164
+ new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
17035
18165
  {
17036
18166
  cause: err.cause || err
17037
18167
  }
17038
18168
  )
17039
18169
  }
17040
18170
 
17041
- throw AxiosError.from(err, err && err.code, config, request);
18171
+ throw AxiosError$1.from(err, err && err.code, config, request);
17042
18172
  }
17043
18173
  });
17044
18174
 
@@ -17083,7 +18213,7 @@ var adapters = {
17083
18213
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
17084
18214
 
17085
18215
  if (adapter === undefined) {
17086
- throw new AxiosError(`Unknown adapter '${id}'`);
18216
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
17087
18217
  }
17088
18218
  }
17089
18219
 
@@ -17105,7 +18235,7 @@ var adapters = {
17105
18235
  (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
17106
18236
  'as no adapter specified';
17107
18237
 
17108
- throw new AxiosError(
18238
+ throw new AxiosError$1(
17109
18239
  `There is no suitable adapter to dispatch the request ` + s,
17110
18240
  'ERR_NOT_SUPPORT'
17111
18241
  );
@@ -17129,7 +18259,7 @@ function throwIfCancellationRequested(config) {
17129
18259
  }
17130
18260
 
17131
18261
  if (config.signal && config.signal.aborted) {
17132
- throw new CanceledError(null, config);
18262
+ throw new CanceledError$1(null, config);
17133
18263
  }
17134
18264
  }
17135
18265
 
@@ -17143,7 +18273,7 @@ function throwIfCancellationRequested(config) {
17143
18273
  function dispatchRequest(config) {
17144
18274
  throwIfCancellationRequested(config);
17145
18275
 
17146
- config.headers = AxiosHeaders.from(config.headers);
18276
+ config.headers = AxiosHeaders$1.from(config.headers);
17147
18277
 
17148
18278
  // Transform request data
17149
18279
  config.data = transformData.call(
@@ -17167,11 +18297,11 @@ function dispatchRequest(config) {
17167
18297
  response
17168
18298
  );
17169
18299
 
17170
- response.headers = AxiosHeaders.from(response.headers);
18300
+ response.headers = AxiosHeaders$1.from(response.headers);
17171
18301
 
17172
18302
  return response;
17173
18303
  }, function onAdapterRejection(reason) {
17174
- if (!isCancel(reason)) {
18304
+ if (!isCancel$1(reason)) {
17175
18305
  throwIfCancellationRequested(config);
17176
18306
 
17177
18307
  // Transform response data
@@ -17181,7 +18311,7 @@ function dispatchRequest(config) {
17181
18311
  config.transformResponse,
17182
18312
  reason.response
17183
18313
  );
17184
- reason.response.headers = AxiosHeaders.from(reason.response.headers);
18314
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
17185
18315
  }
17186
18316
  }
17187
18317
 
@@ -17211,15 +18341,15 @@ const deprecatedWarnings = {};
17211
18341
  */
17212
18342
  validators$1.transitional = function transitional(validator, version, message) {
17213
18343
  function formatMessage(opt, desc) {
17214
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
18344
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
17215
18345
  }
17216
18346
 
17217
18347
  // eslint-disable-next-line func-names
17218
18348
  return (value, opt, opts) => {
17219
18349
  if (validator === false) {
17220
- throw new AxiosError(
18350
+ throw new AxiosError$1(
17221
18351
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
17222
- AxiosError.ERR_DEPRECATED
18352
+ AxiosError$1.ERR_DEPRECATED
17223
18353
  );
17224
18354
  }
17225
18355
 
@@ -17258,7 +18388,7 @@ validators$1.spelling = function spelling(correctSpelling) {
17258
18388
 
17259
18389
  function assertOptions(options, schema, allowUnknown) {
17260
18390
  if (typeof options !== 'object') {
17261
- throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
18391
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
17262
18392
  }
17263
18393
  const keys = Object.keys(options);
17264
18394
  let i = keys.length;
@@ -17269,12 +18399,12 @@ function assertOptions(options, schema, allowUnknown) {
17269
18399
  const value = options[opt];
17270
18400
  const result = value === undefined || validator(value, opt, options);
17271
18401
  if (result !== true) {
17272
- throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
18402
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
17273
18403
  }
17274
18404
  continue;
17275
18405
  }
17276
18406
  if (allowUnknown !== true) {
17277
- throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
18407
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
17278
18408
  }
17279
18409
  }
17280
18410
  }
@@ -17293,9 +18423,9 @@ const validators = validator.validators;
17293
18423
  *
17294
18424
  * @return {Axios} A new instance of Axios
17295
18425
  */
17296
- class Axios {
18426
+ let Axios$1 = class Axios {
17297
18427
  constructor(instanceConfig) {
17298
- this.defaults = instanceConfig;
18428
+ this.defaults = instanceConfig || {};
17299
18429
  this.interceptors = {
17300
18430
  request: new InterceptorManager(),
17301
18431
  response: new InterceptorManager()
@@ -17347,7 +18477,7 @@ class Axios {
17347
18477
  config = configOrUrl || {};
17348
18478
  }
17349
18479
 
17350
- config = mergeConfig(this.defaults, config);
18480
+ config = mergeConfig$1(this.defaults, config);
17351
18481
 
17352
18482
  const {transitional, paramsSerializer, headers} = config;
17353
18483
 
@@ -17372,6 +18502,13 @@ class Axios {
17372
18502
  }
17373
18503
  }
17374
18504
 
18505
+ // Set config.allowAbsoluteUrls
18506
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
18507
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
18508
+ } else {
18509
+ config.allowAbsoluteUrls = true;
18510
+ }
18511
+
17375
18512
  validator.assertOptions(config, {
17376
18513
  baseUrl: validators.spelling('baseURL'),
17377
18514
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -17393,7 +18530,7 @@ class Axios {
17393
18530
  }
17394
18531
  );
17395
18532
 
17396
- config.headers = AxiosHeaders.concat(contextHeaders, headers);
18533
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
17397
18534
 
17398
18535
  // filter out skipped interceptors
17399
18536
  const requestInterceptorChain = [];
@@ -17419,8 +18556,8 @@ class Axios {
17419
18556
 
17420
18557
  if (!synchronousRequestInterceptors) {
17421
18558
  const chain = [dispatchRequest.bind(this), undefined];
17422
- chain.unshift.apply(chain, requestInterceptorChain);
17423
- chain.push.apply(chain, responseInterceptorChain);
18559
+ chain.unshift(...requestInterceptorChain);
18560
+ chain.push(...responseInterceptorChain);
17424
18561
  len = chain.length;
17425
18562
 
17426
18563
  promise = Promise.resolve(config);
@@ -17466,17 +18603,17 @@ class Axios {
17466
18603
  }
17467
18604
 
17468
18605
  getUri(config) {
17469
- config = mergeConfig(this.defaults, config);
17470
- const fullPath = buildFullPath(config.baseURL, config.url);
18606
+ config = mergeConfig$1(this.defaults, config);
18607
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
17471
18608
  return buildURL(fullPath, config.params, config.paramsSerializer);
17472
18609
  }
17473
- }
18610
+ };
17474
18611
 
17475
18612
  // Provide aliases for supported request methods
17476
18613
  utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
17477
18614
  /*eslint func-names:0*/
17478
- Axios.prototype[method] = function(url, config) {
17479
- return this.request(mergeConfig(config || {}, {
18615
+ Axios$1.prototype[method] = function(url, config) {
18616
+ return this.request(mergeConfig$1(config || {}, {
17480
18617
  method,
17481
18618
  url,
17482
18619
  data: (config || {}).data
@@ -17489,7 +18626,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
17489
18626
 
17490
18627
  function generateHTTPMethod(isForm) {
17491
18628
  return function httpMethod(url, data, config) {
17492
- return this.request(mergeConfig(config || {}, {
18629
+ return this.request(mergeConfig$1(config || {}, {
17493
18630
  method,
17494
18631
  headers: isForm ? {
17495
18632
  'Content-Type': 'multipart/form-data'
@@ -17500,9 +18637,9 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
17500
18637
  };
17501
18638
  }
17502
18639
 
17503
- Axios.prototype[method] = generateHTTPMethod();
18640
+ Axios$1.prototype[method] = generateHTTPMethod();
17504
18641
 
17505
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
18642
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
17506
18643
  });
17507
18644
 
17508
18645
  /**
@@ -17512,7 +18649,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
17512
18649
  *
17513
18650
  * @returns {CancelToken}
17514
18651
  */
17515
- class CancelToken {
18652
+ let CancelToken$1 = class CancelToken {
17516
18653
  constructor(executor) {
17517
18654
  if (typeof executor !== 'function') {
17518
18655
  throw new TypeError('executor must be a function.');
@@ -17560,7 +18697,7 @@ class CancelToken {
17560
18697
  return;
17561
18698
  }
17562
18699
 
17563
- token.reason = new CanceledError(message, config, request);
18700
+ token.reason = new CanceledError$1(message, config, request);
17564
18701
  resolvePromise(token.reason);
17565
18702
  });
17566
18703
  }
@@ -17633,7 +18770,7 @@ class CancelToken {
17633
18770
  cancel
17634
18771
  };
17635
18772
  }
17636
- }
18773
+ };
17637
18774
 
17638
18775
  /**
17639
18776
  * Syntactic sugar for invoking a function and expanding an array for arguments.
@@ -17656,7 +18793,7 @@ class CancelToken {
17656
18793
  *
17657
18794
  * @returns {Function}
17658
18795
  */
17659
- function spread(callback) {
18796
+ function spread$1(callback) {
17660
18797
  return function wrap(arr) {
17661
18798
  return callback.apply(null, arr);
17662
18799
  };
@@ -17669,11 +18806,11 @@ function spread(callback) {
17669
18806
  *
17670
18807
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
17671
18808
  */
17672
- function isAxiosError(payload) {
18809
+ function isAxiosError$1(payload) {
17673
18810
  return utils$1.isObject(payload) && (payload.isAxiosError === true);
17674
18811
  }
17675
18812
 
17676
- const HttpStatusCode = {
18813
+ const HttpStatusCode$1 = {
17677
18814
  Continue: 100,
17678
18815
  SwitchingProtocols: 101,
17679
18816
  Processing: 102,
@@ -17739,8 +18876,8 @@ const HttpStatusCode = {
17739
18876
  NetworkAuthenticationRequired: 511,
17740
18877
  };
17741
18878
 
17742
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
17743
- HttpStatusCode[value] = key;
18879
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
18880
+ HttpStatusCode$1[value] = key;
17744
18881
  });
17745
18882
 
17746
18883
  /**
@@ -17751,18 +18888,18 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
17751
18888
  * @returns {Axios} A new instance of Axios
17752
18889
  */
17753
18890
  function createInstance(defaultConfig) {
17754
- const context = new Axios(defaultConfig);
17755
- const instance = bind(Axios.prototype.request, context);
18891
+ const context = new Axios$1(defaultConfig);
18892
+ const instance = bind(Axios$1.prototype.request, context);
17756
18893
 
17757
18894
  // Copy axios.prototype to instance
17758
- utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
18895
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
17759
18896
 
17760
18897
  // Copy context to instance
17761
18898
  utils$1.extend(instance, context, null, {allOwnKeys: true});
17762
18899
 
17763
18900
  // Factory for creating new instances
17764
18901
  instance.create = function create(instanceConfig) {
17765
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
18902
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
17766
18903
  };
17767
18904
 
17768
18905
  return instance;
@@ -17772,17 +18909,17 @@ function createInstance(defaultConfig) {
17772
18909
  const axios = createInstance(defaults);
17773
18910
 
17774
18911
  // Expose Axios class to allow class inheritance
17775
- axios.Axios = Axios;
18912
+ axios.Axios = Axios$1;
17776
18913
 
17777
18914
  // Expose Cancel & CancelToken
17778
- axios.CanceledError = CanceledError;
17779
- axios.CancelToken = CancelToken;
17780
- axios.isCancel = isCancel;
17781
- axios.VERSION = VERSION;
17782
- axios.toFormData = toFormData;
18915
+ axios.CanceledError = CanceledError$1;
18916
+ axios.CancelToken = CancelToken$1;
18917
+ axios.isCancel = isCancel$1;
18918
+ axios.VERSION = VERSION$1;
18919
+ axios.toFormData = toFormData$1;
17783
18920
 
17784
18921
  // Expose AxiosError class
17785
- axios.AxiosError = AxiosError;
18922
+ axios.AxiosError = AxiosError$1;
17786
18923
 
17787
18924
  // alias for CanceledError for backward compatibility
17788
18925
  axios.Cancel = axios.CanceledError;
@@ -17792,24 +18929,46 @@ axios.all = function all(promises) {
17792
18929
  return Promise.all(promises);
17793
18930
  };
17794
18931
 
17795
- axios.spread = spread;
18932
+ axios.spread = spread$1;
17796
18933
 
17797
18934
  // Expose isAxiosError
17798
- axios.isAxiosError = isAxiosError;
18935
+ axios.isAxiosError = isAxiosError$1;
17799
18936
 
17800
18937
  // Expose mergeConfig
17801
- axios.mergeConfig = mergeConfig;
18938
+ axios.mergeConfig = mergeConfig$1;
17802
18939
 
17803
- axios.AxiosHeaders = AxiosHeaders;
18940
+ axios.AxiosHeaders = AxiosHeaders$1;
17804
18941
 
17805
18942
  axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
17806
18943
 
17807
18944
  axios.getAdapter = adapters.getAdapter;
17808
18945
 
17809
- axios.HttpStatusCode = HttpStatusCode;
18946
+ axios.HttpStatusCode = HttpStatusCode$1;
17810
18947
 
17811
18948
  axios.default = axios;
17812
18949
 
18950
+ // This module is intended to unwrap Axios default export as named.
18951
+ // Keep top-level export same with static properties
18952
+ // so that it can keep same with es module or cjs
18953
+ const {
18954
+ Axios,
18955
+ AxiosError,
18956
+ CanceledError,
18957
+ isCancel,
18958
+ CancelToken,
18959
+ VERSION,
18960
+ all,
18961
+ Cancel,
18962
+ isAxiosError,
18963
+ spread,
18964
+ toFormData,
18965
+ AxiosHeaders,
18966
+ HttpStatusCode,
18967
+ formToJSON,
18968
+ getAdapter,
18969
+ mergeConfig
18970
+ } = axios;
18971
+
17813
18972
  class BaseClient {
17814
18973
  constructor(client) {
17815
18974
  this.client = client;
@@ -17845,11 +19004,13 @@ const isBrowser = typeof window !== "undefined" &&
17845
19004
  class PlatformBaseClient extends BaseClient {
17846
19005
  constructor(options) {
17847
19006
  var _a, _b;
17848
- let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
19007
+ let { env = null, token = null, host = null, } = options !== null && options !== void 0 ? options : {};
17849
19008
  let headers = {};
19009
+ var project_uuid = null;
17850
19010
  if (isBrowser) {
17851
- if (localStorage.getItem('protokol_context') == "forge") {
17852
- headers['X-Project-Env'] = (_a = localStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
19011
+ console.log("DEBUG", sessionStorage.getItem('protokol_context'));
19012
+ if (sessionStorage.getItem('protokol_context') == "forge") {
19013
+ headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== void 0 ? _a : "dev";
17853
19014
  }
17854
19015
  else {
17855
19016
  // this potentially means that it is running as dev server in local
@@ -17858,11 +19019,12 @@ class PlatformBaseClient extends BaseClient {
17858
19019
  }
17859
19020
  if (typeof window !== "undefined") {
17860
19021
  // @ts-ignore
17861
- const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
17862
- host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
19022
+ const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
19023
+ host = (_b = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.API_HOST) !== null && _b !== void 0 ? _b : host;
17863
19024
  // @ts-ignore
17864
- env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
17865
- token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
19025
+ env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
19026
+ token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
19027
+ project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
17866
19028
  }
17867
19029
  if (token) {
17868
19030
  headers['Authorization'] = `Bearer ${token}`;
@@ -17870,9 +19032,12 @@ class PlatformBaseClient extends BaseClient {
17870
19032
  if (env) {
17871
19033
  headers['X-Project-Env'] = env;
17872
19034
  }
19035
+ if (project_uuid) {
19036
+ headers['X-Project-Uuid'] = project_uuid;
19037
+ }
17873
19038
  const client = axios.create({
17874
- baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io",
17875
- timeout: 15000,
19039
+ baseURL: host !== null && host !== void 0 ? host : "https://lemon.protokol.io",
19040
+ timeout: 30000,
17876
19041
  headers: {
17877
19042
  ...headers,
17878
19043
  'Content-Type': 'application/json',
@@ -18008,7 +19173,11 @@ class Apps extends PlatformBaseClient {
18008
19173
  }
18009
19174
  async upload(formData) {
18010
19175
  return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
18011
- timeout: 60000
19176
+ timeout: 60000,
19177
+ headers: {
19178
+ // set form data headers
19179
+ 'Content-Type': 'multipart/form-data'
19180
+ }
18012
19181
  });
18013
19182
  }
18014
19183
  }
@@ -18040,7 +19209,7 @@ class Component extends PlatformBaseClient {
18040
19209
  * )
18041
19210
  **/
18042
19211
  async find(filters, opts) {
18043
- const { cache = false, buildttl = -1, locale = "en_US", } = opts !== null && opts !== undefined ? opts : {};
19212
+ const { cache = false, buildttl = -1, locale = "en_US", } = opts !== null && opts !== void 0 ? opts : {};
18044
19213
  let payload = {
18045
19214
  context: filters,
18046
19215
  ref: this.ref,
@@ -18080,6 +19249,9 @@ class Component extends PlatformBaseClient {
18080
19249
  }
18081
19250
  if (opts) {
18082
19251
  Object.keys(opts).forEach(k => {
19252
+ if (['cache', 'buildttl', 'locale'].includes(k)) {
19253
+ return;
19254
+ }
18083
19255
  params[`_opt_${k}`] = opts ? opts[k] : null;
18084
19256
  });
18085
19257
  }
@@ -18204,7 +19376,7 @@ class Component extends PlatformBaseClient {
18204
19376
  });
18205
19377
  }
18206
19378
  async workflow(event, input) {
18207
- return await this.client.post(`/v1/system/component/${this.ref}/workflow/event`, {
19379
+ return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
18208
19380
  event,
18209
19381
  input
18210
19382
  });
@@ -18335,7 +19507,7 @@ class Platform extends PlatformBaseClient {
18335
19507
  }
18336
19508
  getPlatformBaseURL() {
18337
19509
  var _a;
18338
- return (_a = this.client.defaults.baseURL) !== null && _a !== undefined ? _a : "";
19510
+ return (_a = this.client.defaults.baseURL) !== null && _a !== void 0 ? _a : "";
18339
19511
  }
18340
19512
  apiUser() {
18341
19513
  return (new APIUser()).setClient(this.client);
@@ -18406,11 +19578,12 @@ class Invoicing extends PlatformBaseClient {
18406
19578
  class IntegrationsBaseClient extends BaseClient {
18407
19579
  constructor(options) {
18408
19580
  var _a, _b;
18409
- let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
19581
+ let { env = null, token, host, } = options !== null && options !== void 0 ? options : {};
18410
19582
  let headers = {};
19583
+ var project_uuid = null;
18411
19584
  if (isBrowser) {
18412
- if (localStorage.getItem('protokol_context') == "forge") {
18413
- headers['X-Project-Env'] = (_a = localStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
19585
+ if (sessionStorage.getItem('protokol_context') == "forge") {
19586
+ headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== void 0 ? _a : "dev";
18414
19587
  }
18415
19588
  else {
18416
19589
  // this potentially means that it is running as dev server in local
@@ -18419,12 +19592,13 @@ class IntegrationsBaseClient extends BaseClient {
18419
19592
  }
18420
19593
  if (typeof window !== "undefined") {
18421
19594
  // @ts-ignore
18422
- const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
18423
- host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
19595
+ const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
19596
+ host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== void 0 ? _b : host;
18424
19597
  // @ts-ignore
18425
- token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
19598
+ token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
18426
19599
  // @ts-ignore
18427
- env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
19600
+ env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
19601
+ project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
18428
19602
  }
18429
19603
  if (token) {
18430
19604
  headers['Authorization'] = `Bearer ${token}`;
@@ -18432,9 +19606,12 @@ class IntegrationsBaseClient extends BaseClient {
18432
19606
  if (env) {
18433
19607
  headers['X-Project-Env'] = env;
18434
19608
  }
19609
+ if (project_uuid) {
19610
+ headers['X-Project-Uuid'] = project_uuid;
19611
+ }
18435
19612
  const client = axios.create({
18436
- baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
18437
- timeout: 15000,
19613
+ baseURL: host !== null && host !== void 0 ? host : "https://lemon.protokol.io/luma/integrations",
19614
+ timeout: 30000,
18438
19615
  headers: {
18439
19616
  ...headers,
18440
19617
  },
@@ -18511,7 +19688,7 @@ class DMS extends IntegrationsBaseClient {
18511
19688
  return this.request('GET', `media/library/${lib}/exif/${key}`);
18512
19689
  }
18513
19690
  async html2pdf(lib, data) {
18514
- const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
19691
+ const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData } = data;
18515
19692
  const type = output_pdf ? 'arraybuffer' : 'json';
18516
19693
  const contentType = output_pdf ? 'application/pdf' : 'application/json';
18517
19694
  return this.request('POST', `media/library/${lib}/html2pdf`, {
@@ -18521,6 +19698,7 @@ class DMS extends IntegrationsBaseClient {
18521
19698
  output_path,
18522
19699
  input_html,
18523
19700
  output_file_name,
19701
+ output_type,
18524
19702
  data: templateData
18525
19703
  },
18526
19704
  headers: {
@@ -18603,7 +19781,7 @@ class Payments extends IntegrationsBaseClient {
18603
19781
  return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, {
18604
19782
  totalAmount: options.totalAmount.toString(),
18605
19783
  description: options.description,
18606
- redirectUrl: (_a = options.redirectUrl) !== null && _a !== undefined ? _a : null,
19784
+ redirectUrl: (_a = options.redirectUrl) !== null && _a !== void 0 ? _a : null,
18607
19785
  });
18608
19786
  }
18609
19787
  }