@jingx/lottery-components-react-jsx 1.0.45 → 1.0.46
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 +1051 -1892
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1052 -1893
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -3190,10 +3190,10 @@ var applyBind = function applyBind() {
|
|
|
3190
3190
|
|
|
3191
3191
|
module.exports = function callBind(originalFunction) {
|
|
3192
3192
|
var func = callBindBasic(arguments);
|
|
3193
|
-
var adjustedLength =
|
|
3193
|
+
var adjustedLength = originalFunction.length - (arguments.length - 1);
|
|
3194
3194
|
return setFunctionLength$1(
|
|
3195
3195
|
func,
|
|
3196
|
-
adjustedLength > 0 ? adjustedLength : 0,
|
|
3196
|
+
1 + (adjustedLength > 0 ? adjustedLength : 0),
|
|
3197
3197
|
true
|
|
3198
3198
|
);
|
|
3199
3199
|
};
|
|
@@ -6252,7 +6252,7 @@ Popper$1.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
|
|
|
6252
6252
|
Popper$1.placements = placements;
|
|
6253
6253
|
Popper$1.Defaults = Defaults;
|
|
6254
6254
|
|
|
6255
|
-
var lib = {exports: {}};
|
|
6255
|
+
var lib$1 = {exports: {}};
|
|
6256
6256
|
|
|
6257
6257
|
var implementation = {exports: {}};
|
|
6258
6258
|
|
|
@@ -6541,10 +6541,10 @@ var implementationExports = implementation.exports;
|
|
|
6541
6541
|
|
|
6542
6542
|
exports$1.default = _react2.default.createContext || _implementation2.default;
|
|
6543
6543
|
module.exports = exports$1['default'];
|
|
6544
|
-
} (lib, lib.exports));
|
|
6544
|
+
} (lib$1, lib$1.exports));
|
|
6545
6545
|
|
|
6546
|
-
var libExports = lib.exports;
|
|
6547
|
-
var createContext = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
6546
|
+
var libExports$1 = lib$1.exports;
|
|
6547
|
+
var createContext = /*@__PURE__*/getDefaultExportFromCjs(libExports$1);
|
|
6548
6548
|
|
|
6549
6549
|
var ManagerReferenceNodeContext = createContext();
|
|
6550
6550
|
var ManagerReferenceNodeSetterContext = createContext();
|
|
@@ -12295,7 +12295,7 @@ lodash.exports;
|
|
|
12295
12295
|
var undefined$1;
|
|
12296
12296
|
|
|
12297
12297
|
/** Used as the semantic version number. */
|
|
12298
|
-
var VERSION = '4.
|
|
12298
|
+
var VERSION = '4.17.21';
|
|
12299
12299
|
|
|
12300
12300
|
/** Used as the size to enable large array optimizations. */
|
|
12301
12301
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -12303,8 +12303,7 @@ lodash.exports;
|
|
|
12303
12303
|
/** Error message constants. */
|
|
12304
12304
|
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
|
12305
12305
|
FUNC_ERROR_TEXT = 'Expected a function',
|
|
12306
|
-
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'
|
|
12307
|
-
INVALID_TEMPL_IMPORTS_ERROR_TEXT = 'Invalid `imports` option passed into `_.template`';
|
|
12306
|
+
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
|
|
12308
12307
|
|
|
12309
12308
|
/** Used to stand-in for `undefined` hash values. */
|
|
12310
12309
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
@@ -14036,10 +14035,6 @@ lodash.exports;
|
|
|
14036
14035
|
* embedded Ruby (ERB) as well as ES2015 template strings. Change the
|
|
14037
14036
|
* following template settings to use alternative delimiters.
|
|
14038
14037
|
*
|
|
14039
|
-
* **Security:** See
|
|
14040
|
-
* [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md)
|
|
14041
|
-
* — `_.template` is insecure and will be removed in v5.
|
|
14042
|
-
*
|
|
14043
14038
|
* @static
|
|
14044
14039
|
* @memberOf _
|
|
14045
14040
|
* @type {Object}
|
|
@@ -14588,7 +14583,7 @@ lodash.exports;
|
|
|
14588
14583
|
* @name has
|
|
14589
14584
|
* @memberOf SetCache
|
|
14590
14585
|
* @param {*} value The value to search for.
|
|
14591
|
-
* @returns {
|
|
14586
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
14592
14587
|
*/
|
|
14593
14588
|
function setCacheHas(value) {
|
|
14594
14589
|
return this.__data__.has(value);
|
|
@@ -16054,7 +16049,7 @@ lodash.exports;
|
|
|
16054
16049
|
if (isArray(iteratee)) {
|
|
16055
16050
|
return function(value) {
|
|
16056
16051
|
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
16057
|
-
}
|
|
16052
|
+
}
|
|
16058
16053
|
}
|
|
16059
16054
|
return iteratee;
|
|
16060
16055
|
});
|
|
@@ -16658,34 +16653,8 @@ lodash.exports;
|
|
|
16658
16653
|
*/
|
|
16659
16654
|
function baseUnset(object, path) {
|
|
16660
16655
|
path = castPath(path, object);
|
|
16661
|
-
|
|
16662
|
-
|
|
16663
|
-
// https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
16664
|
-
// https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh
|
|
16665
|
-
var index = -1,
|
|
16666
|
-
length = path.length;
|
|
16667
|
-
|
|
16668
|
-
if (!length) {
|
|
16669
|
-
return true;
|
|
16670
|
-
}
|
|
16671
|
-
|
|
16672
|
-
while (++index < length) {
|
|
16673
|
-
var key = toKey(path[index]);
|
|
16674
|
-
|
|
16675
|
-
// Always block "__proto__" anywhere in the path if it's not expected
|
|
16676
|
-
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
16677
|
-
return false;
|
|
16678
|
-
}
|
|
16679
|
-
|
|
16680
|
-
// Block constructor/prototype as non-terminal traversal keys to prevent
|
|
16681
|
-
// escaping the object graph into built-in constructors and prototypes.
|
|
16682
|
-
if ((key === 'constructor' || key === 'prototype') && index < length - 1) {
|
|
16683
|
-
return false;
|
|
16684
|
-
}
|
|
16685
|
-
}
|
|
16686
|
-
|
|
16687
|
-
var obj = parent(object, path);
|
|
16688
|
-
return obj == null || delete obj[toKey(last(path))];
|
|
16656
|
+
object = parent(object, path);
|
|
16657
|
+
return object == null || delete object[toKey(last(path))];
|
|
16689
16658
|
}
|
|
16690
16659
|
|
|
16691
16660
|
/**
|
|
@@ -19236,7 +19205,7 @@ lodash.exports;
|
|
|
19236
19205
|
|
|
19237
19206
|
/**
|
|
19238
19207
|
* Creates an array with all falsey values removed. The values `false`, `null`,
|
|
19239
|
-
* `0`,
|
|
19208
|
+
* `0`, `""`, `undefined`, and `NaN` are falsey.
|
|
19240
19209
|
*
|
|
19241
19210
|
* @static
|
|
19242
19211
|
* @memberOf _
|
|
@@ -19775,7 +19744,7 @@ lodash.exports;
|
|
|
19775
19744
|
|
|
19776
19745
|
while (++index < length) {
|
|
19777
19746
|
var pair = pairs[index];
|
|
19778
|
-
|
|
19747
|
+
result[pair[0]] = pair[1];
|
|
19779
19748
|
}
|
|
19780
19749
|
return result;
|
|
19781
19750
|
}
|
|
@@ -26435,8 +26404,6 @@ lodash.exports;
|
|
|
26435
26404
|
* **Note:** JavaScript follows the IEEE-754 standard for resolving
|
|
26436
26405
|
* floating-point values which can produce unexpected results.
|
|
26437
26406
|
*
|
|
26438
|
-
* **Note:** If `lower` is greater than `upper`, the values are swapped.
|
|
26439
|
-
*
|
|
26440
26407
|
* @static
|
|
26441
26408
|
* @memberOf _
|
|
26442
26409
|
* @since 0.7.0
|
|
@@ -26450,16 +26417,9 @@ lodash.exports;
|
|
|
26450
26417
|
* _.random(0, 5);
|
|
26451
26418
|
* // => an integer between 0 and 5
|
|
26452
26419
|
*
|
|
26453
|
-
* // when lower is greater than upper the values are swapped
|
|
26454
|
-
* _.random(5, 0);
|
|
26455
|
-
* // => an integer between 0 and 5
|
|
26456
|
-
*
|
|
26457
26420
|
* _.random(5);
|
|
26458
26421
|
* // => also an integer between 0 and 5
|
|
26459
26422
|
*
|
|
26460
|
-
* _.random(-5);
|
|
26461
|
-
* // => an integer between -5 and 0
|
|
26462
|
-
*
|
|
26463
26423
|
* _.random(5, true);
|
|
26464
26424
|
* // => a floating-point number between 0 and 5
|
|
26465
26425
|
*
|
|
@@ -27061,10 +27021,6 @@ lodash.exports;
|
|
|
27061
27021
|
* properties may be accessed as free variables in the template. If a setting
|
|
27062
27022
|
* object is given, it takes precedence over `_.templateSettings` values.
|
|
27063
27023
|
*
|
|
27064
|
-
* **Security:** `_.template` is insecure and should not be used. It will be
|
|
27065
|
-
* removed in Lodash v5. Avoid untrusted input. See
|
|
27066
|
-
* [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md).
|
|
27067
|
-
*
|
|
27068
27024
|
* **Note:** In the development build `_.template` utilizes
|
|
27069
27025
|
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
|
27070
27026
|
* for easier debugging.
|
|
@@ -27172,18 +27128,12 @@ lodash.exports;
|
|
|
27172
27128
|
options = undefined$1;
|
|
27173
27129
|
}
|
|
27174
27130
|
string = toString(string);
|
|
27175
|
-
options =
|
|
27131
|
+
options = assignInWith({}, options, settings, customDefaultsAssignIn);
|
|
27176
27132
|
|
|
27177
|
-
var imports =
|
|
27133
|
+
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
|
|
27178
27134
|
importsKeys = keys(imports),
|
|
27179
27135
|
importsValues = baseValues(imports, importsKeys);
|
|
27180
27136
|
|
|
27181
|
-
arrayEach(importsKeys, function(key) {
|
|
27182
|
-
if (reForbiddenIdentifierChars.test(key)) {
|
|
27183
|
-
throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT);
|
|
27184
|
-
}
|
|
27185
|
-
});
|
|
27186
|
-
|
|
27187
27137
|
var isEscaping,
|
|
27188
27138
|
isEvaluating,
|
|
27189
27139
|
index = 0,
|
|
@@ -29532,9 +29482,9 @@ var lodashExports = lodash.exports;
|
|
|
29532
29482
|
var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
|
|
29533
29483
|
|
|
29534
29484
|
/**
|
|
29535
|
-
* react-number-format - 5.4.
|
|
29485
|
+
* react-number-format - 5.4.4
|
|
29536
29486
|
* Author : Sudhanshu Yadav
|
|
29537
|
-
* Copyright (c) 2016,
|
|
29487
|
+
* Copyright (c) 2016, 2025 to Sudhanshu Yadav, released under the MIT license.
|
|
29538
29488
|
* https://github.com/s-yadav/react-number-format
|
|
29539
29489
|
*/
|
|
29540
29490
|
|
|
@@ -29976,7 +29926,7 @@ function useInternalValues(value, defaultValue, valueIsNumericString, format, re
|
|
|
29976
29926
|
});
|
|
29977
29927
|
var values = ref[0];
|
|
29978
29928
|
var setValues = ref[1];
|
|
29979
|
-
var _onValueChange =
|
|
29929
|
+
var _onValueChange = function (newValues, sourceInfo) {
|
|
29980
29930
|
if (newValues.formattedValue !== values.formattedValue) {
|
|
29981
29931
|
setValues({
|
|
29982
29932
|
formattedValue: newValues.formattedValue,
|
|
@@ -29985,7 +29935,7 @@ function useInternalValues(value, defaultValue, valueIsNumericString, format, re
|
|
|
29985
29935
|
}
|
|
29986
29936
|
// call parent on value change if only if formatted value is changed
|
|
29987
29937
|
onValueChange(newValues, sourceInfo);
|
|
29988
|
-
}
|
|
29938
|
+
};
|
|
29989
29939
|
// if value is switch from controlled to uncontrolled, use the internal state's value to format with new props
|
|
29990
29940
|
var _value = value;
|
|
29991
29941
|
var _valueIsNumericString = valueIsNumericString;
|
|
@@ -29997,21 +29947,6 @@ function useInternalValues(value, defaultValue, valueIsNumericString, format, re
|
|
|
29997
29947
|
React.useMemo(function () {
|
|
29998
29948
|
setValues(newValues);
|
|
29999
29949
|
}, [newValues.formattedValue]);
|
|
30000
|
-
/**
|
|
30001
|
-
* When only a defaultValue is provided (value prop is nil), the initial formatted value is
|
|
30002
|
-
* derived by the library — the parent has not yet been informed of this formatted result.
|
|
30003
|
-
* Fire onValueChange once on mount so the parent can sync to the formatted value.
|
|
30004
|
-
*/
|
|
30005
|
-
React.useEffect(function () {
|
|
30006
|
-
if (!isNil(defaultValue) && isNil(value) && values.formattedValue !== '') {
|
|
30007
|
-
var floatValue = parseFloat(values.numAsString);
|
|
30008
|
-
_onValueChange({
|
|
30009
|
-
formattedValue: values.formattedValue,
|
|
30010
|
-
value: values.numAsString,
|
|
30011
|
-
floatValue: isNaN(floatValue) ? undefined : floatValue,
|
|
30012
|
-
}, { event: undefined, source: SourceType.props });
|
|
30013
|
-
}
|
|
30014
|
-
}, []);
|
|
30015
29950
|
return [values, _onValueChange];
|
|
30016
29951
|
}
|
|
30017
29952
|
|
|
@@ -30566,9 +30501,7 @@ function getCaretBoundary(formattedValue, props) {
|
|
|
30566
30501
|
var boundaryAry = Array.from({ length: formattedValue.length + 1 }).map(function () { return true; });
|
|
30567
30502
|
var hasNegation = formattedValue[0] === '-';
|
|
30568
30503
|
// fill for prefix and negation
|
|
30569
|
-
|
|
30570
|
-
// is just '-' (negation only, e.g. during intermediate typing with a multi-char prefix)
|
|
30571
|
-
boundaryAry.fill(false, 0, Math.min(prefix.length + (hasNegation ? 1 : 0), formattedValue.length));
|
|
30504
|
+
boundaryAry.fill(false, 0, prefix.length + (hasNegation ? 1 : 0));
|
|
30572
30505
|
// fill for suffix
|
|
30573
30506
|
var valLn = formattedValue.length;
|
|
30574
30507
|
boundaryAry.fill(false, valLn - suffix.length + 1, valLn + 1);
|
|
@@ -30653,10 +30586,7 @@ function useNumericFormat(props) {
|
|
|
30653
30586
|
var selectionEnd = el.selectionEnd;
|
|
30654
30587
|
var value = el.value; if ( value === void 0 ) value = '';
|
|
30655
30588
|
// if user tries to delete partial prefix then ignore it
|
|
30656
|
-
|
|
30657
|
-
// is at position 1 which is < prefix.length for multi-char prefixes — we must allow
|
|
30658
|
-
// backspace to delete the lone negation sign in this state
|
|
30659
|
-
if ((key === 'Backspace' || key === 'Delete') && selectionEnd < prefix.length && value !== '-') {
|
|
30589
|
+
if ((key === 'Backspace' || key === 'Delete') && selectionEnd < prefix.length) {
|
|
30660
30590
|
e.preventDefault();
|
|
30661
30591
|
return;
|
|
30662
30592
|
}
|
|
@@ -37657,389 +37587,13 @@ const ProtestTicket = ({
|
|
|
37657
37587
|
] }) }) });
|
|
37658
37588
|
};
|
|
37659
37589
|
|
|
37660
|
-
|
|
37661
|
-
|
|
37662
|
-
|
|
37663
|
-
return t.width = `${document.documentElement.clientWidth}px`, t.height = `${document.documentElement.clientHeight}px`, t.style.position = "absolute", t.style.top = `-${document.documentElement.clientHeight + 100}px`, t.style.left = `-${document.documentElement.clientWidth + 100}px`, t.id = q, t.srcdoc = "<!DOCTYPE html>", e && (e.allow && (t.allow = e.allow), e.referrerPolicy !== void 0 && (t.referrerPolicy = e.referrerPolicy), e.sandbox !== void 0 && (t.sandbox = e.sandbox)), t;
|
|
37664
|
-
}
|
|
37665
|
-
|
|
37666
|
-
|
|
37667
|
-
}
|
|
37668
|
-
function $(e, t) {
|
|
37669
|
-
if (t || !e) {
|
|
37670
|
-
const n = document.getElementById(q);
|
|
37671
|
-
n && document.body.removeChild(n);
|
|
37672
|
-
}
|
|
37673
|
-
}
|
|
37674
|
-
function P(e) {
|
|
37675
|
-
return e instanceof Error ? e : new Error("Unknown Error");
|
|
37676
|
-
}
|
|
37677
|
-
function H(e, t) {
|
|
37678
|
-
const {
|
|
37679
|
-
documentTitle: n,
|
|
37680
|
-
onAfterPrint: l,
|
|
37681
|
-
onPrintError: p,
|
|
37682
|
-
preserveAfterPrint: m,
|
|
37683
|
-
print: h,
|
|
37684
|
-
suppressErrors: g
|
|
37685
|
-
} = t;
|
|
37686
|
-
setTimeout(() => {
|
|
37687
|
-
if (e.contentWindow) {
|
|
37688
|
-
let a = function() {
|
|
37689
|
-
l?.(), $(m);
|
|
37690
|
-
};
|
|
37691
|
-
if (e.contentWindow.focus(), h)
|
|
37692
|
-
h(e).then(a).catch((c) => {
|
|
37693
|
-
p ? p("print", P(c)) : f({
|
|
37694
|
-
messages: ["An error was thrown by the specified `print` function"],
|
|
37695
|
-
suppressErrors: g
|
|
37696
|
-
});
|
|
37697
|
-
});
|
|
37698
|
-
else {
|
|
37699
|
-
if (e.contentWindow.print) {
|
|
37700
|
-
const c = e.contentDocument?.title ?? "", E = e.ownerDocument.title, y = typeof n == "function" ? n() : n;
|
|
37701
|
-
y && (e.ownerDocument.title = y, e.contentDocument && (e.contentDocument.title = y)), e.contentWindow.print(), y && (e.ownerDocument.title = E, e.contentDocument && (e.contentDocument.title = c));
|
|
37702
|
-
} else
|
|
37703
|
-
f({
|
|
37704
|
-
messages: ["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],
|
|
37705
|
-
suppressErrors: g
|
|
37706
|
-
});
|
|
37707
|
-
z() ? setTimeout(a, 500) : a();
|
|
37708
|
-
}
|
|
37709
|
-
} else
|
|
37710
|
-
f({
|
|
37711
|
-
messages: ["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],
|
|
37712
|
-
suppressErrors: g
|
|
37713
|
-
});
|
|
37714
|
-
}, 500);
|
|
37715
|
-
}
|
|
37716
|
-
function z() {
|
|
37717
|
-
return [
|
|
37718
|
-
/Android/i,
|
|
37719
|
-
/webOS/i,
|
|
37720
|
-
/iPhone/i,
|
|
37721
|
-
/iPad/i,
|
|
37722
|
-
/iPod/i,
|
|
37723
|
-
/BlackBerry/i,
|
|
37724
|
-
/Windows Phone/i
|
|
37725
|
-
].some((t) => (
|
|
37726
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
37727
|
-
(navigator.userAgent ?? // Retained for compatibility with browsers that use `navigator.vendor` to identify the browser.
|
|
37728
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
37729
|
-
navigator.vendor ?? // Retained for compatibility with older versions of Opera that use `window.opera`.
|
|
37730
|
-
("opera" in window && window.opera)).match(t)
|
|
37731
|
-
));
|
|
37732
|
-
}
|
|
37733
|
-
function O(e) {
|
|
37734
|
-
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, null);
|
|
37735
|
-
let l = n.nextNode();
|
|
37736
|
-
for (; l; )
|
|
37737
|
-
t.push(l), l = n.nextNode();
|
|
37738
|
-
return t;
|
|
37739
|
-
}
|
|
37740
|
-
function j$1(e, t, n) {
|
|
37741
|
-
const l = O(e), p = O(t);
|
|
37742
|
-
if (l.length !== p.length) {
|
|
37743
|
-
f({
|
|
37744
|
-
messages: ["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.", e, t],
|
|
37745
|
-
suppressErrors: n
|
|
37746
|
-
});
|
|
37747
|
-
return;
|
|
37748
|
-
}
|
|
37749
|
-
for (let m = 0; m < l.length; m++) {
|
|
37750
|
-
const h = l[m], g = p[m], a = h.shadowRoot;
|
|
37751
|
-
if (a !== null) {
|
|
37752
|
-
const c = g.attachShadow({ mode: a.mode });
|
|
37753
|
-
c.innerHTML = a.innerHTML, j$1(a, c, n);
|
|
37754
|
-
}
|
|
37755
|
-
}
|
|
37756
|
-
}
|
|
37757
|
-
const G$1 = `
|
|
37758
|
-
@page {
|
|
37759
|
-
/* Remove browser default header (title) and footer (url) */
|
|
37760
|
-
margin: 0;
|
|
37761
|
-
}
|
|
37762
|
-
@media print {
|
|
37763
|
-
body {
|
|
37764
|
-
/* Tell browsers to print background colors */
|
|
37765
|
-
color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */
|
|
37766
|
-
print-color-adjust: exact; /* Firefox/Safari */
|
|
37767
|
-
-webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */
|
|
37768
|
-
}
|
|
37769
|
-
}
|
|
37770
|
-
`;
|
|
37771
|
-
function W(e, t, n) {
|
|
37772
|
-
const {
|
|
37773
|
-
contentNode: l,
|
|
37774
|
-
clonedContentNode: p,
|
|
37775
|
-
clonedImgNodes: m,
|
|
37776
|
-
clonedVideoNodes: h,
|
|
37777
|
-
numResourcesToLoad: g,
|
|
37778
|
-
originalCanvasNodes: a
|
|
37779
|
-
} = t, {
|
|
37780
|
-
bodyClass: c,
|
|
37781
|
-
fonts: E,
|
|
37782
|
-
ignoreGlobalStyles: y,
|
|
37783
|
-
pageStyle: C,
|
|
37784
|
-
nonce: T,
|
|
37785
|
-
suppressErrors: A,
|
|
37786
|
-
copyShadowRoots: F
|
|
37787
|
-
} = n, L = [], _ = [];
|
|
37788
|
-
function i(k, x) {
|
|
37789
|
-
if (L.includes(k)) {
|
|
37790
|
-
f({
|
|
37791
|
-
level: "debug",
|
|
37792
|
-
messages: ["Tried to mark a resource that has already been handled", k],
|
|
37793
|
-
suppressErrors: A
|
|
37794
|
-
});
|
|
37795
|
-
return;
|
|
37796
|
-
}
|
|
37797
|
-
x ? (f({
|
|
37798
|
-
messages: [
|
|
37799
|
-
'"react-to-print" was unable to load a resource but will continue attempting to print the page',
|
|
37800
|
-
...x
|
|
37801
|
-
],
|
|
37802
|
-
suppressErrors: A
|
|
37803
|
-
}), _.push(k)) : L.push(k), L.length + _.length === g && H(e, n);
|
|
37804
|
-
}
|
|
37805
|
-
e.onload = null;
|
|
37806
|
-
const d = e.contentDocument ?? e.contentWindow?.document;
|
|
37807
|
-
if (d) {
|
|
37808
|
-
const k = d.body.appendChild(p);
|
|
37809
|
-
F && j$1(l, k, !!A), E && (e.contentDocument?.fonts && e.contentWindow?.FontFace ? E.forEach((s) => {
|
|
37810
|
-
const o = new FontFace(
|
|
37811
|
-
s.family,
|
|
37812
|
-
s.source,
|
|
37813
|
-
{ weight: s.weight, style: s.style }
|
|
37814
|
-
);
|
|
37815
|
-
e.contentDocument.fonts.add(o), o.loaded.then(() => {
|
|
37816
|
-
i(o);
|
|
37817
|
-
}).catch((b) => {
|
|
37818
|
-
i(o, ["Failed loading the font:", o, "Load error:", P(b)]);
|
|
37819
|
-
});
|
|
37820
|
-
}) : (E.forEach((s) => {
|
|
37821
|
-
i(s);
|
|
37822
|
-
}), f({
|
|
37823
|
-
messages: ['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],
|
|
37824
|
-
suppressErrors: A
|
|
37825
|
-
})));
|
|
37826
|
-
const x = C ?? G$1, D = d.createElement("style");
|
|
37827
|
-
T && (D.setAttribute("nonce", T), d.head.setAttribute("nonce", T)), D.appendChild(d.createTextNode(x)), d.head.appendChild(D), c && d.body.classList.add(...c.split(" "));
|
|
37828
|
-
const U = d.querySelectorAll("canvas");
|
|
37829
|
-
for (let s = 0; s < a.length; ++s) {
|
|
37830
|
-
const o = a[s], b = U[s];
|
|
37831
|
-
if (b === void 0) {
|
|
37832
|
-
f({
|
|
37833
|
-
messages: ["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.", o],
|
|
37834
|
-
suppressErrors: A
|
|
37835
|
-
});
|
|
37836
|
-
continue;
|
|
37837
|
-
}
|
|
37838
|
-
const r = b.getContext("2d");
|
|
37839
|
-
r && r.drawImage(o, 0, 0);
|
|
37840
|
-
}
|
|
37841
|
-
for (let s = 0; s < m.length; s++) {
|
|
37842
|
-
const o = m[s], b = o.getAttribute("src");
|
|
37843
|
-
if (!b)
|
|
37844
|
-
i(o, ['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.', o]);
|
|
37845
|
-
else {
|
|
37846
|
-
const r = new Image();
|
|
37847
|
-
r.onload = () => {
|
|
37848
|
-
i(o);
|
|
37849
|
-
}, r.onerror = (u, w, S, v, N) => {
|
|
37850
|
-
i(o, ["Error loading <img>", o, "Error", N]);
|
|
37851
|
-
}, r.src = b;
|
|
37852
|
-
}
|
|
37853
|
-
}
|
|
37854
|
-
for (let s = 0; s < h.length; s++) {
|
|
37855
|
-
const o = h[s];
|
|
37856
|
-
o.preload = "auto";
|
|
37857
|
-
const b = o.getAttribute("poster");
|
|
37858
|
-
if (b) {
|
|
37859
|
-
const r = new Image();
|
|
37860
|
-
r.onload = () => {
|
|
37861
|
-
i(o);
|
|
37862
|
-
}, r.onerror = (u, w, S, v, N) => {
|
|
37863
|
-
i(o, ["Error loading video poster", b, "for video", o, "Error:", N]);
|
|
37864
|
-
}, r.src = b;
|
|
37865
|
-
} else
|
|
37866
|
-
o.readyState >= 2 ? i(o) : o.src ? (o.onloadeddata = () => {
|
|
37867
|
-
i(o);
|
|
37868
|
-
}, o.onerror = (r, u, w, S, v) => {
|
|
37869
|
-
i(o, ["Error loading video", o, "Error", v]);
|
|
37870
|
-
}, o.onstalled = () => {
|
|
37871
|
-
i(o, ["Loading video stalled, skipping", o]);
|
|
37872
|
-
}) : i(o, ["Error loading video, `src` is empty", o]);
|
|
37873
|
-
}
|
|
37874
|
-
const R = "select", M = l.querySelectorAll(R), B = d.querySelectorAll(R);
|
|
37875
|
-
for (let s = 0; s < M.length; s++)
|
|
37876
|
-
B[s].value = M[s].value;
|
|
37877
|
-
if (!y) {
|
|
37878
|
-
const s = document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");
|
|
37879
|
-
for (let o = 0, b = s.length; o < b; ++o) {
|
|
37880
|
-
const r = s[o];
|
|
37881
|
-
if (r.tagName.toLowerCase() === "style") {
|
|
37882
|
-
const u = d.createElement(r.tagName), w = r.sheet;
|
|
37883
|
-
if (w) {
|
|
37884
|
-
let S = "";
|
|
37885
|
-
try {
|
|
37886
|
-
const v = w.cssRules.length;
|
|
37887
|
-
for (let N = 0; N < v; ++N)
|
|
37888
|
-
typeof w.cssRules[N].cssText == "string" && (S += `${w.cssRules[N].cssText}\r
|
|
37889
|
-
`);
|
|
37890
|
-
} catch (v) {
|
|
37891
|
-
f({
|
|
37892
|
-
messages: [
|
|
37893
|
-
"A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",
|
|
37894
|
-
// eslint-disable-line max-len
|
|
37895
|
-
r,
|
|
37896
|
-
`Original error: ${P(v).message}`
|
|
37897
|
-
],
|
|
37898
|
-
level: "warning"
|
|
37899
|
-
});
|
|
37900
|
-
}
|
|
37901
|
-
u.setAttribute("id", `react-to-print-${o}`), T && u.setAttribute("nonce", T), u.appendChild(d.createTextNode(S)), d.head.appendChild(u);
|
|
37902
|
-
}
|
|
37903
|
-
} else if (r.getAttribute("href"))
|
|
37904
|
-
if (r.hasAttribute("disabled"))
|
|
37905
|
-
f({
|
|
37906
|
-
messages: ["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:", r],
|
|
37907
|
-
level: "warning"
|
|
37908
|
-
}), i(r);
|
|
37909
|
-
else {
|
|
37910
|
-
const u = d.createElement(r.tagName);
|
|
37911
|
-
for (let w = 0, S = r.attributes.length; w < S; ++w) {
|
|
37912
|
-
const v = r.attributes[w];
|
|
37913
|
-
v && u.setAttribute(v.nodeName, v.nodeValue ?? "");
|
|
37914
|
-
}
|
|
37915
|
-
u.onload = () => {
|
|
37916
|
-
i(u);
|
|
37917
|
-
}, u.onerror = (w, S, v, N, I) => {
|
|
37918
|
-
i(u, ["Failed to load", u, "Error:", I]);
|
|
37919
|
-
}, T && u.setAttribute("nonce", T), d.head.appendChild(u);
|
|
37920
|
-
}
|
|
37921
|
-
else
|
|
37922
|
-
f({
|
|
37923
|
-
messages: ["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:", r],
|
|
37924
|
-
level: "warning"
|
|
37925
|
-
}), i(r);
|
|
37926
|
-
}
|
|
37927
|
-
}
|
|
37928
|
-
}
|
|
37929
|
-
g === 0 && H(e, n);
|
|
37930
|
-
}
|
|
37931
|
-
function J(e, t, n) {
|
|
37932
|
-
e.onload = () => {
|
|
37933
|
-
W(
|
|
37934
|
-
e,
|
|
37935
|
-
t,
|
|
37936
|
-
n
|
|
37937
|
-
);
|
|
37938
|
-
}, document.body.appendChild(e);
|
|
37939
|
-
}
|
|
37940
|
-
function K({ contentRef: e, optionalContent: t, suppressErrors: n }) {
|
|
37941
|
-
if (t && typeof t == "function")
|
|
37942
|
-
return e && f({
|
|
37943
|
-
level: "warning",
|
|
37944
|
-
messages: ['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']
|
|
37945
|
-
}), t();
|
|
37946
|
-
if (e)
|
|
37947
|
-
return e.current;
|
|
37948
|
-
f({
|
|
37949
|
-
messages: ['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],
|
|
37950
|
-
suppressErrors: n
|
|
37951
|
-
});
|
|
37952
|
-
}
|
|
37953
|
-
function Q(e, t) {
|
|
37954
|
-
const {
|
|
37955
|
-
contentRef: n,
|
|
37956
|
-
fonts: l,
|
|
37957
|
-
ignoreGlobalStyles: p,
|
|
37958
|
-
suppressErrors: m
|
|
37959
|
-
} = t, h = K({
|
|
37960
|
-
contentRef: n,
|
|
37961
|
-
optionalContent: e,
|
|
37962
|
-
suppressErrors: m
|
|
37963
|
-
});
|
|
37964
|
-
if (!h)
|
|
37965
|
-
return;
|
|
37966
|
-
const g = h.cloneNode(true), a = document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"), c = g.querySelectorAll("img"), E = g.querySelectorAll("video"), y = l ? l.length : 0, C = (p ? 0 : a.length) + c.length + E.length + y;
|
|
37967
|
-
return {
|
|
37968
|
-
contentNode: h,
|
|
37969
|
-
clonedContentNode: g,
|
|
37970
|
-
clonedImgNodes: c,
|
|
37971
|
-
clonedVideoNodes: E,
|
|
37972
|
-
numResourcesToLoad: C,
|
|
37973
|
-
originalCanvasNodes: h.querySelectorAll("canvas")
|
|
37974
|
-
};
|
|
37975
|
-
}
|
|
37976
|
-
function Z({
|
|
37977
|
-
bodyClass: e,
|
|
37978
|
-
contentRef: t,
|
|
37979
|
-
copyShadowRoots: n,
|
|
37980
|
-
documentTitle: l,
|
|
37981
|
-
fonts: p,
|
|
37982
|
-
ignoreGlobalStyles: m,
|
|
37983
|
-
nonce: h,
|
|
37984
|
-
onAfterPrint: g,
|
|
37985
|
-
onBeforePrint: a,
|
|
37986
|
-
onPrintError: c,
|
|
37987
|
-
pageStyle: E,
|
|
37988
|
-
preserveAfterPrint: y,
|
|
37989
|
-
print: C,
|
|
37990
|
-
printIframeProps: T,
|
|
37991
|
-
suppressErrors: A
|
|
37992
|
-
}) {
|
|
37993
|
-
return React.useCallback((L) => {
|
|
37994
|
-
$(y, true);
|
|
37995
|
-
function _() {
|
|
37996
|
-
const i = {
|
|
37997
|
-
bodyClass: e,
|
|
37998
|
-
contentRef: t,
|
|
37999
|
-
copyShadowRoots: n,
|
|
38000
|
-
documentTitle: l,
|
|
38001
|
-
fonts: p,
|
|
38002
|
-
ignoreGlobalStyles: m,
|
|
38003
|
-
nonce: h,
|
|
38004
|
-
onAfterPrint: g,
|
|
38005
|
-
onPrintError: c,
|
|
38006
|
-
pageStyle: E,
|
|
38007
|
-
preserveAfterPrint: y,
|
|
38008
|
-
print: C,
|
|
38009
|
-
suppressErrors: A
|
|
38010
|
-
}, d = V(T), k = Q(L, i);
|
|
38011
|
-
if (!k) {
|
|
38012
|
-
f({
|
|
38013
|
-
messages: ["There is nothing to print"],
|
|
38014
|
-
suppressErrors: A
|
|
38015
|
-
});
|
|
38016
|
-
return;
|
|
38017
|
-
}
|
|
38018
|
-
J(d, k, i);
|
|
38019
|
-
}
|
|
38020
|
-
a ? a().then(() => {
|
|
38021
|
-
_();
|
|
38022
|
-
}).catch((i) => {
|
|
38023
|
-
c?.("onBeforePrint", P(i));
|
|
38024
|
-
}) : _();
|
|
38025
|
-
}, [
|
|
38026
|
-
e,
|
|
38027
|
-
t,
|
|
38028
|
-
n,
|
|
38029
|
-
l,
|
|
38030
|
-
p,
|
|
38031
|
-
m,
|
|
38032
|
-
h,
|
|
38033
|
-
g,
|
|
38034
|
-
a,
|
|
38035
|
-
c,
|
|
38036
|
-
E,
|
|
38037
|
-
y,
|
|
38038
|
-
T,
|
|
38039
|
-
C,
|
|
38040
|
-
A
|
|
38041
|
-
]);
|
|
38042
|
-
}
|
|
37590
|
+
var lib = {exports: {}};
|
|
37591
|
+
|
|
37592
|
+
(function (module, exports$1) {
|
|
37593
|
+
!function(e,t){module.exports=t(React);}("undefined"!=typeof self?self:commonjsGlobal,function(e){return function(){var t={155:function(t){t.exports=e;}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:true,get:t[o]});},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:true});};var r={};n.r(r),n.d(r,{useReactToPrint:function(){return g}});var s=n(155);const i="printWindow";function l({level:e="error",messages:t,suppressErrors:o=false}){o||("error"===e?console.error(t):"warning"===e?console.warn(t):console.debug(t));}function a(e,t){if(t||!e){const e=document.getElementById(i);e&&document.body.removeChild(e);}}function c(e){return e instanceof Error?e:new Error("Unknown Error")}function d(e,t){const{documentTitle:o,onAfterPrint:n,onPrintError:r,preserveAfterPrint:s,print:i,suppressErrors:d}=t;setTimeout(()=>{var t,u;if(e.contentWindow){function p(){null==n||n(),a(s);}if(e.contentWindow.focus(),i)i(e).then(p).catch(e=>{r?r("print",c(e)):l({messages:["An error was thrown by the specified `print` function"],suppressErrors:d});});else {if(e.contentWindow.print){const f=null!==(u=null===(t=e.contentDocument)||void 0===t?void 0:t.title)&&void 0!==u?u:"",h=e.ownerDocument.title;o&&(e.ownerDocument.title=o,e.contentDocument&&(e.contentDocument.title=o)),e.contentWindow.print(),o&&(e.ownerDocument.title=h,e.contentDocument&&(e.contentDocument.title=f));}else l({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:d});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>{var t,o;return (null!==(o=null!==(t=navigator.userAgent)&&void 0!==t?t:navigator.vendor)&&void 0!==o?o:"opera"in window&&window.opera).match(e)})?setTimeout(p,500):p();}}else l({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:d});},500);}function u(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null);let n=o.nextNode();for(;n;)t.push(n),n=o.nextNode();return t}function p(e,t,o){const n=u(e),r=u(t);if(n.length===r.length)for(let e=0;e<n.length;e++){const t=n[e],s=r[e],i=t.shadowRoot;if(null!==i){const e=s.attachShadow({mode:i.mode});e.innerHTML=i.innerHTML,p(i,e,o);}}else l({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",e,t],suppressErrors:o});}const f='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function h(e,t,o,n){var r,s,i,a,u;const{contentNode:h,clonedContentNode:g,clonedImgNodes:m,clonedVideoNodes:b,numResourcesToLoad:y,originalCanvasNodes:v}=o,{bodyClass:w,fonts:E,ignoreGlobalStyles:A,pageStyle:P,nonce:T,suppressErrors:S,copyShadowRoots:x}=n;e.onload=null;const k=null!==(r=e.contentDocument)&&void 0!==r?r:null===(s=e.contentWindow)||void 0===s?void 0:s.document;if(k){const o=k.body.appendChild(g);x&&p(h,o,!!S),E&&((null===(i=e.contentDocument)||void 0===i?void 0:i.fonts)&&(null===(a=e.contentWindow)||void 0===a?void 0:a.FontFace)?E.forEach(o=>{const n=new FontFace(o.family,o.source,{weight:o.weight,style:o.style});e.contentDocument.fonts.add(n),n.loaded.then(()=>{t(n);}).catch(e=>{t(n,["Failed loading the font:",n,"Load error:",c(e)]);});}):(E.forEach(e=>{t(e);}),l({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:S})));const n=null!=P?P:f,r=k.createElement("style");T&&(r.setAttribute("nonce",T),k.head.setAttribute("nonce",T)),r.appendChild(k.createTextNode(n)),k.head.appendChild(r),w&&k.body.classList.add(...w.split(" "));const s=k.querySelectorAll("canvas");for(let e=0;e<v.length;++e){const t=v[e],o=s[e];if(void 0===o){l({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",t],suppressErrors:S});continue}const n=o.getContext("2d");n&&n.drawImage(t,0,0);}for(let e=0;e<m.length;e++){const o=m[e],n=o.getAttribute("src");if(n){const e=new Image;e.onload=()=>{t(o);},e.onerror=(e,n,r,s,i)=>{t(o,["Error loading <img>",o,"Error",i]);},e.src=n;}else t(o,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',o]);}for(let e=0;e<b.length;e++){const o=b[e];o.preload="auto";const n=o.getAttribute("poster");if(n){const e=new Image;e.onload=()=>{t(o);},e.onerror=(e,r,s,i,l)=>{t(o,["Error loading video poster",n,"for video",o,"Error:",l]);},e.src=n;}else o.readyState>=2?t(o):o.src?(o.onloadeddata=()=>{t(o);},o.onerror=(e,n,r,s,i)=>{t(o,["Error loading video",o,"Error",i]);},o.onstalled=()=>{t(o,["Loading video stalled, skipping",o]);}):t(o,["Error loading video, `src` is empty",o]);}const d="select",y=h.querySelectorAll(d),C=k.querySelectorAll(d);for(let e=0;e<y.length;e++)C[e].value=y[e].value;if(!A){const e=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let o=0,n=e.length;o<n;++o){const n=e[o];if("style"===n.tagName.toLowerCase()){const e=k.createElement(n.tagName),t=n.sheet;if(t){let r="";try{const e=t.cssRules.length;for(let o=0;o<e;++o)"string"==typeof t.cssRules[o].cssText&&(r+=`${t.cssRules[o].cssText}\r\n`);}catch(e){l({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",n,`Original error: ${c(e).message}`],level:"warning"});}e.setAttribute("id",`react-to-print-${o}`),T&&e.setAttribute("nonce",T),e.appendChild(k.createTextNode(r)),k.head.appendChild(e);}}else if(n.getAttribute("href"))if(n.hasAttribute("disabled"))l({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",n],level:"warning"}),t(n);else {const e=k.createElement(n.tagName);for(let t=0,o=n.attributes.length;t<o;++t){const o=n.attributes[t];o&&e.setAttribute(o.nodeName,null!==(u=o.nodeValue)&&void 0!==u?u:"");}e.onload=()=>{t(e);},e.onerror=(o,n,r,s,i)=>{t(e,["Failed to load",e,"Error:",i]);},T&&e.setAttribute("nonce",T),k.head.appendChild(e);}else l({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",n],level:"warning"}),t(n);}}}0===y&&d(e,n);}function g({bodyClass:e,contentRef:t,copyShadowRoots:o,documentTitle:n,fonts:r,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onBeforePrint:g,onPrintError:m,pageStyle:b,preserveAfterPrint:y,print:v,printIframeProps:w,suppressErrors:E}){const A=(0, s.useCallback)(s=>{function A(){const a={bodyClass:e,contentRef:t,copyShadowRoots:o,documentTitle:n,fonts:r,ignoreGlobalStyles:u,nonce:p,onAfterPrint:f,onPrintError:m,pageStyle:b,preserveAfterPrint:y,print:v,suppressErrors:E},c=function(e){const t=document.createElement("iframe");return t.width=`${document.documentElement.clientWidth}px`,t.height=`${document.documentElement.clientHeight}px`,t.style.position="absolute",t.style.top=`-${document.documentElement.clientHeight+100}px`,t.style.left=`-${document.documentElement.clientWidth+100}px`,t.id=i,t.srcdoc="<!DOCTYPE html>",e&&(e.allow&&(t.allow=e.allow),void 0!==e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),void 0!==e.sandbox&&(t.sandbox=e.sandbox)),t}(w),A=function(e,t){const{contentRef:o,fonts:n,ignoreGlobalStyles:r,suppressErrors:s}=t,i=function({contentRef:e,optionalContent:t,suppressErrors:o}){return t&&"function"==typeof t?(e&&l({level:"warning",messages:['"react-to-print" received a `contentRef` option and an optional-content param passed to its callback. The `contentRef` option will be ignored.']}),t()):e?e.current:void l({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:o})}({contentRef:o,optionalContent:e,suppressErrors:s});if(!i)return;const a=i.cloneNode(true),c=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),d=a.querySelectorAll("img"),u=a.querySelectorAll("video"),p=n?n.length:0;return {contentNode:i,clonedContentNode:a,clonedImgNodes:d,clonedVideoNodes:u,numResourcesToLoad:(r?0:c.length)+d.length+u.length+p,originalCanvasNodes:i.querySelectorAll("canvas")}}(s,a);if(!A)return void l({messages:["There is nothing to print"],suppressErrors:E});const P=function(e,t,o){const{suppressErrors:n}=e,r=[],s=[];return function(i,a){r.includes(i)?l({level:"debug",messages:["Tried to mark a resource that has already been handled",i],suppressErrors:n}):(a?(l({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...a],suppressErrors:n}),s.push(i)):r.push(i),r.length+s.length===t&&d(o,e));}}(a,A.numResourcesToLoad,c);!function(e,t,o,n){e.onload=()=>{h(e,t,o,n);},document.body.appendChild(e);}(c,P,A,a);}a(y,true),g?g().then(()=>{A();}).catch(e=>{null==m||m("onBeforePrint",c(e));}):A();},[e,t,o,n,r,u,p,f,g,m,b,y,v,E]);return A}return r}()});
|
|
37594
|
+
} (lib));
|
|
37595
|
+
|
|
37596
|
+
var libExports = lib.exports;
|
|
38043
37597
|
|
|
38044
37598
|
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
|
38045
37599
|
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
|
@@ -38074,7 +37628,7 @@ const BasePrinter = (_a) => {
|
|
|
38074
37628
|
"onAfterPrint"
|
|
38075
37629
|
]);
|
|
38076
37630
|
const contentRef = React.useRef(null);
|
|
38077
|
-
const reactToPrintFn =
|
|
37631
|
+
const reactToPrintFn = libExports.useReactToPrint({ contentRef, onAfterPrint });
|
|
38078
37632
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScopeHost, { className: "", children: [
|
|
38079
37633
|
/* @__PURE__ */ jsxRuntime.jsx("div", { id, className: `cur-pointer ${className}`, onClick: reactToPrintFn, children }),
|
|
38080
37634
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -46147,7 +45701,7 @@ const TicketModalWrapper = (props) => {
|
|
|
46147
45701
|
const reportRef = React.useRef(null);
|
|
46148
45702
|
const actionButtonsRef = React.useRef(null);
|
|
46149
45703
|
const contentRef = React.useRef(null);
|
|
46150
|
-
const reactToPrintFn =
|
|
45704
|
+
const reactToPrintFn = libExports.useReactToPrint({ contentRef, onAfterPrint });
|
|
46151
45705
|
const handleCopyImage = async () => {
|
|
46152
45706
|
await copyImageToClipboard(contentRef, actionButtonsRef, lotteryLabel[lotteryType], object == null ? void 0 : object.ticketNumber);
|
|
46153
45707
|
await onAfterPrint();
|
|
@@ -53920,7 +53474,7 @@ var StateManagedSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
53920
53474
|
});
|
|
53921
53475
|
var StateManagedSelect$1 = StateManagedSelect;
|
|
53922
53476
|
|
|
53923
|
-
/*! Axios v1.
|
|
53477
|
+
/*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
53924
53478
|
|
|
53925
53479
|
/**
|
|
53926
53480
|
* Create a bound version of a function with a specified `this` context
|
|
@@ -54125,9 +53679,9 @@ const isFile = kindOfTest('File');
|
|
|
54125
53679
|
* also have a `name` and `type` attribute to specify filename and content type
|
|
54126
53680
|
*
|
|
54127
53681
|
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
54128
|
-
*
|
|
53682
|
+
*
|
|
54129
53683
|
* @param {*} value The value to test
|
|
54130
|
-
*
|
|
53684
|
+
*
|
|
54131
53685
|
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
54132
53686
|
*/
|
|
54133
53687
|
const isReactNativeBlob = (value) => {
|
|
@@ -54137,9 +53691,9 @@ const isReactNativeBlob = (value) => {
|
|
|
54137
53691
|
/**
|
|
54138
53692
|
* Determine if environment is React Native
|
|
54139
53693
|
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
54140
|
-
*
|
|
53694
|
+
*
|
|
54141
53695
|
* @param {*} formData The formData to test
|
|
54142
|
-
*
|
|
53696
|
+
*
|
|
54143
53697
|
* @returns {boolean} True if environment is React Native, otherwise false
|
|
54144
53698
|
*/
|
|
54145
53699
|
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
@@ -54158,7 +53712,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
54158
53712
|
*
|
|
54159
53713
|
* @param {*} val The value to test
|
|
54160
53714
|
*
|
|
54161
|
-
* @returns {boolean} True if value is a
|
|
53715
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
54162
53716
|
*/
|
|
54163
53717
|
const isFileList = kindOfTest('FileList');
|
|
54164
53718
|
|
|
@@ -54192,16 +53746,14 @@ const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
|
54192
53746
|
const isFormData = (thing) => {
|
|
54193
53747
|
if (!thing) return false;
|
|
54194
53748
|
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
54195
|
-
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
|
|
53749
|
+
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
|
|
54196
53750
|
const proto = getPrototypeOf(thing);
|
|
54197
53751
|
if (!proto || proto === Object.prototype) return false;
|
|
54198
53752
|
if (!isFunction$1(thing.append)) return false;
|
|
54199
53753
|
const kind = kindOf(thing);
|
|
54200
|
-
return
|
|
54201
|
-
kind === 'formdata' ||
|
|
53754
|
+
return kind === 'formdata' ||
|
|
54202
53755
|
// detect form-data instance
|
|
54203
|
-
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
54204
|
-
);
|
|
53756
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
|
|
54205
53757
|
};
|
|
54206
53758
|
|
|
54207
53759
|
/**
|
|
@@ -54336,7 +53888,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
54336
53888
|
*
|
|
54337
53889
|
* @returns {Object} Result of all merge properties
|
|
54338
53890
|
*/
|
|
54339
|
-
function merge(...
|
|
53891
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
|
54340
53892
|
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
54341
53893
|
const result = {};
|
|
54342
53894
|
const assignValue = (val, key) => {
|
|
@@ -54346,12 +53898,8 @@ function merge(...objs) {
|
|
|
54346
53898
|
}
|
|
54347
53899
|
|
|
54348
53900
|
const targetKey = (caseless && findKey(result, key)) || key;
|
|
54349
|
-
|
|
54350
|
-
|
|
54351
|
-
// copied into the merged result.
|
|
54352
|
-
const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
|
|
54353
|
-
if (isPlainObject(existing) && isPlainObject(val)) {
|
|
54354
|
-
result[targetKey] = merge(existing, val);
|
|
53901
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
53902
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
54355
53903
|
} else if (isPlainObject(val)) {
|
|
54356
53904
|
result[targetKey] = merge({}, val);
|
|
54357
53905
|
} else if (isArray(val)) {
|
|
@@ -54361,8 +53909,8 @@ function merge(...objs) {
|
|
|
54361
53909
|
}
|
|
54362
53910
|
};
|
|
54363
53911
|
|
|
54364
|
-
for (let i = 0, l =
|
|
54365
|
-
|
|
53912
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
53913
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
54366
53914
|
}
|
|
54367
53915
|
return result;
|
|
54368
53916
|
}
|
|
@@ -54384,9 +53932,6 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
54384
53932
|
(val, key) => {
|
|
54385
53933
|
if (thisArg && isFunction$1(val)) {
|
|
54386
53934
|
Object.defineProperty(a, key, {
|
|
54387
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
54388
|
-
// hijack defineProperty's accessor-vs-data resolution.
|
|
54389
|
-
__proto__: null,
|
|
54390
53935
|
value: bind(val, thisArg),
|
|
54391
53936
|
writable: true,
|
|
54392
53937
|
enumerable: true,
|
|
@@ -54394,7 +53939,6 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
54394
53939
|
});
|
|
54395
53940
|
} else {
|
|
54396
53941
|
Object.defineProperty(a, key, {
|
|
54397
|
-
__proto__: null,
|
|
54398
53942
|
value: val,
|
|
54399
53943
|
writable: true,
|
|
54400
53944
|
enumerable: true,
|
|
@@ -54433,14 +53977,12 @@ const stripBOM = (content) => {
|
|
|
54433
53977
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
54434
53978
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
54435
53979
|
Object.defineProperty(constructor.prototype, 'constructor', {
|
|
54436
|
-
__proto__: null,
|
|
54437
53980
|
value: constructor,
|
|
54438
53981
|
writable: true,
|
|
54439
53982
|
enumerable: false,
|
|
54440
53983
|
configurable: true,
|
|
54441
53984
|
});
|
|
54442
53985
|
Object.defineProperty(constructor, 'super', {
|
|
54443
|
-
__proto__: null,
|
|
54444
53986
|
value: superConstructor.prototype,
|
|
54445
53987
|
});
|
|
54446
53988
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -54622,7 +54164,7 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
54622
54164
|
const freezeMethods = (obj) => {
|
|
54623
54165
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
54624
54166
|
// skip restricted props in strict mode
|
|
54625
|
-
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].
|
|
54167
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
54626
54168
|
return false;
|
|
54627
54169
|
}
|
|
54628
54170
|
|
|
@@ -54696,11 +54238,11 @@ function isSpecCompliantForm(thing) {
|
|
|
54696
54238
|
* @returns {Object} The JSON-compatible object.
|
|
54697
54239
|
*/
|
|
54698
54240
|
const toJSONObject = (obj) => {
|
|
54699
|
-
const
|
|
54241
|
+
const stack = new Array(10);
|
|
54700
54242
|
|
|
54701
|
-
const visit = (source) => {
|
|
54243
|
+
const visit = (source, i) => {
|
|
54702
54244
|
if (isObject(source)) {
|
|
54703
|
-
if (
|
|
54245
|
+
if (stack.indexOf(source) >= 0) {
|
|
54704
54246
|
return;
|
|
54705
54247
|
}
|
|
54706
54248
|
|
|
@@ -54710,16 +54252,15 @@ const toJSONObject = (obj) => {
|
|
|
54710
54252
|
}
|
|
54711
54253
|
|
|
54712
54254
|
if (!('toJSON' in source)) {
|
|
54713
|
-
|
|
54714
|
-
visited.add(source);
|
|
54255
|
+
stack[i] = source;
|
|
54715
54256
|
const target = isArray(source) ? [] : {};
|
|
54716
54257
|
|
|
54717
54258
|
forEach(source, (value, key) => {
|
|
54718
|
-
const reducedValue = visit(value);
|
|
54259
|
+
const reducedValue = visit(value, i + 1);
|
|
54719
54260
|
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
54720
54261
|
});
|
|
54721
54262
|
|
|
54722
|
-
|
|
54263
|
+
stack[i] = undefined;
|
|
54723
54264
|
|
|
54724
54265
|
return target;
|
|
54725
54266
|
}
|
|
@@ -54728,7 +54269,7 @@ const toJSONObject = (obj) => {
|
|
|
54728
54269
|
return source;
|
|
54729
54270
|
};
|
|
54730
54271
|
|
|
54731
|
-
return visit(obj);
|
|
54272
|
+
return visit(obj, 0);
|
|
54732
54273
|
};
|
|
54733
54274
|
|
|
54734
54275
|
/**
|
|
@@ -54864,883 +54405,335 @@ var utils$1 = {
|
|
|
54864
54405
|
isIterable,
|
|
54865
54406
|
};
|
|
54866
54407
|
|
|
54867
|
-
|
|
54868
|
-
|
|
54869
|
-
const
|
|
54870
|
-
|
|
54871
|
-
|
|
54872
|
-
|
|
54873
|
-
|
|
54874
|
-
|
|
54875
|
-
|
|
54876
|
-
|
|
54877
|
-
|
|
54878
|
-
|
|
54879
|
-
|
|
54880
|
-
|
|
54881
|
-
|
|
54882
|
-
|
|
54883
|
-
|
|
54884
|
-
|
|
54885
|
-
|
|
54886
|
-
|
|
54887
|
-
]
|
|
54408
|
+
class AxiosError extends Error {
|
|
54409
|
+
static from(error, code, config, request, response, customProps) {
|
|
54410
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
54411
|
+
axiosError.cause = error;
|
|
54412
|
+
axiosError.name = error.name;
|
|
54413
|
+
|
|
54414
|
+
// Preserve status from the original error if not already set from response
|
|
54415
|
+
if (error.status != null && axiosError.status == null) {
|
|
54416
|
+
axiosError.status = error.status;
|
|
54417
|
+
}
|
|
54418
|
+
|
|
54419
|
+
customProps && Object.assign(axiosError, customProps);
|
|
54420
|
+
return axiosError;
|
|
54421
|
+
}
|
|
54422
|
+
|
|
54423
|
+
/**
|
|
54424
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
54425
|
+
*
|
|
54426
|
+
* @param {string} message The error message.
|
|
54427
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
54428
|
+
* @param {Object} [config] The config.
|
|
54429
|
+
* @param {Object} [request] The request.
|
|
54430
|
+
* @param {Object} [response] The response.
|
|
54431
|
+
*
|
|
54432
|
+
* @returns {Error} The created error.
|
|
54433
|
+
*/
|
|
54434
|
+
constructor(message, code, config, request, response) {
|
|
54435
|
+
super(message);
|
|
54436
|
+
|
|
54437
|
+
// Make message enumerable to maintain backward compatibility
|
|
54438
|
+
// The native Error constructor sets message as non-enumerable,
|
|
54439
|
+
// but axios < v1.13.3 had it as enumerable
|
|
54440
|
+
Object.defineProperty(this, 'message', {
|
|
54441
|
+
value: message,
|
|
54442
|
+
enumerable: true,
|
|
54443
|
+
writable: true,
|
|
54444
|
+
configurable: true,
|
|
54445
|
+
});
|
|
54446
|
+
|
|
54447
|
+
this.name = 'AxiosError';
|
|
54448
|
+
this.isAxiosError = true;
|
|
54449
|
+
code && (this.code = code);
|
|
54450
|
+
config && (this.config = config);
|
|
54451
|
+
request && (this.request = request);
|
|
54452
|
+
if (response) {
|
|
54453
|
+
this.response = response;
|
|
54454
|
+
this.status = response.status;
|
|
54455
|
+
}
|
|
54456
|
+
}
|
|
54457
|
+
|
|
54458
|
+
toJSON() {
|
|
54459
|
+
return {
|
|
54460
|
+
// Standard
|
|
54461
|
+
message: this.message,
|
|
54462
|
+
name: this.name,
|
|
54463
|
+
// Microsoft
|
|
54464
|
+
description: this.description,
|
|
54465
|
+
number: this.number,
|
|
54466
|
+
// Mozilla
|
|
54467
|
+
fileName: this.fileName,
|
|
54468
|
+
lineNumber: this.lineNumber,
|
|
54469
|
+
columnNumber: this.columnNumber,
|
|
54470
|
+
stack: this.stack,
|
|
54471
|
+
// Axios
|
|
54472
|
+
config: utils$1.toJSONObject(this.config),
|
|
54473
|
+
code: this.code,
|
|
54474
|
+
status: this.status,
|
|
54475
|
+
};
|
|
54476
|
+
}
|
|
54477
|
+
}
|
|
54478
|
+
|
|
54479
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
54480
|
+
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
54481
|
+
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
54482
|
+
AxiosError.ECONNABORTED = 'ECONNABORTED';
|
|
54483
|
+
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
|
|
54484
|
+
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
|
|
54485
|
+
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
54486
|
+
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
54487
|
+
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
54488
|
+
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
54489
|
+
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
54490
|
+
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
54491
|
+
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
54492
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
54493
|
+
|
|
54494
|
+
// eslint-disable-next-line strict
|
|
54495
|
+
var httpAdapter = null;
|
|
54888
54496
|
|
|
54889
54497
|
/**
|
|
54890
|
-
*
|
|
54498
|
+
* Determines if the given thing is a array or js object.
|
|
54891
54499
|
*
|
|
54892
|
-
*
|
|
54893
|
-
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
54894
|
-
* Content-Type: application/json
|
|
54895
|
-
* Connection: keep-alive
|
|
54896
|
-
* Transfer-Encoding: chunked
|
|
54897
|
-
* ```
|
|
54500
|
+
* @param {string} thing - The object or array to be visited.
|
|
54898
54501
|
*
|
|
54899
|
-
* @
|
|
54502
|
+
* @returns {boolean}
|
|
54503
|
+
*/
|
|
54504
|
+
function isVisitable(thing) {
|
|
54505
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
54506
|
+
}
|
|
54507
|
+
|
|
54508
|
+
/**
|
|
54509
|
+
* It removes the brackets from the end of a string
|
|
54900
54510
|
*
|
|
54901
|
-
* @
|
|
54511
|
+
* @param {string} key - The key of the parameter.
|
|
54512
|
+
*
|
|
54513
|
+
* @returns {string} the key without the brackets.
|
|
54902
54514
|
*/
|
|
54903
|
-
|
|
54904
|
-
|
|
54905
|
-
|
|
54906
|
-
let val;
|
|
54907
|
-
let i;
|
|
54515
|
+
function removeBrackets(key) {
|
|
54516
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
54517
|
+
}
|
|
54908
54518
|
|
|
54909
|
-
|
|
54910
|
-
|
|
54911
|
-
|
|
54912
|
-
|
|
54913
|
-
|
|
54519
|
+
/**
|
|
54520
|
+
* It takes a path, a key, and a boolean, and returns a string
|
|
54521
|
+
*
|
|
54522
|
+
* @param {string} path - The path to the current key.
|
|
54523
|
+
* @param {string} key - The key of the current object being iterated over.
|
|
54524
|
+
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
54525
|
+
*
|
|
54526
|
+
* @returns {string} The path to the current key.
|
|
54527
|
+
*/
|
|
54528
|
+
function renderKey(path, key, dots) {
|
|
54529
|
+
if (!path) return key;
|
|
54530
|
+
return path
|
|
54531
|
+
.concat(key)
|
|
54532
|
+
.map(function each(token, i) {
|
|
54533
|
+
// eslint-disable-next-line no-param-reassign
|
|
54534
|
+
token = removeBrackets(token);
|
|
54535
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
54536
|
+
})
|
|
54537
|
+
.join(dots ? '.' : '');
|
|
54538
|
+
}
|
|
54914
54539
|
|
|
54915
|
-
|
|
54916
|
-
|
|
54917
|
-
|
|
54540
|
+
/**
|
|
54541
|
+
* If the array is an array and none of its elements are visitable, then it's a flat array.
|
|
54542
|
+
*
|
|
54543
|
+
* @param {Array<any>} arr - The array to check
|
|
54544
|
+
*
|
|
54545
|
+
* @returns {boolean}
|
|
54546
|
+
*/
|
|
54547
|
+
function isFlatArray(arr) {
|
|
54548
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
54549
|
+
}
|
|
54918
54550
|
|
|
54919
|
-
|
|
54920
|
-
|
|
54921
|
-
|
|
54922
|
-
} else {
|
|
54923
|
-
parsed[key] = [val];
|
|
54924
|
-
}
|
|
54925
|
-
} else {
|
|
54926
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
54927
|
-
}
|
|
54928
|
-
});
|
|
54551
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
54552
|
+
return /^is[A-Z]/.test(prop);
|
|
54553
|
+
});
|
|
54929
54554
|
|
|
54930
|
-
|
|
54931
|
-
|
|
54555
|
+
/**
|
|
54556
|
+
* Convert a data object to FormData
|
|
54557
|
+
*
|
|
54558
|
+
* @param {Object} obj
|
|
54559
|
+
* @param {?Object} [formData]
|
|
54560
|
+
* @param {?Object} [options]
|
|
54561
|
+
* @param {Function} [options.visitor]
|
|
54562
|
+
* @param {Boolean} [options.metaTokens = true]
|
|
54563
|
+
* @param {Boolean} [options.dots = false]
|
|
54564
|
+
* @param {?Boolean} [options.indexes = false]
|
|
54565
|
+
*
|
|
54566
|
+
* @returns {Object}
|
|
54567
|
+
**/
|
|
54932
54568
|
|
|
54933
|
-
|
|
54934
|
-
|
|
54935
|
-
|
|
54569
|
+
/**
|
|
54570
|
+
* It converts an object into a FormData object
|
|
54571
|
+
*
|
|
54572
|
+
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
54573
|
+
* @param {string} formData - The FormData object to append to.
|
|
54574
|
+
* @param {Object<string, any>} options
|
|
54575
|
+
*
|
|
54576
|
+
* @returns
|
|
54577
|
+
*/
|
|
54578
|
+
function toFormData(obj, formData, options) {
|
|
54579
|
+
if (!utils$1.isObject(obj)) {
|
|
54580
|
+
throw new TypeError('target must be an object');
|
|
54581
|
+
}
|
|
54936
54582
|
|
|
54937
|
-
|
|
54938
|
-
|
|
54583
|
+
// eslint-disable-next-line no-param-reassign
|
|
54584
|
+
formData = formData || new (FormData)();
|
|
54939
54585
|
|
|
54940
|
-
|
|
54941
|
-
|
|
54586
|
+
// eslint-disable-next-line no-param-reassign
|
|
54587
|
+
options = utils$1.toFlatObject(
|
|
54588
|
+
options,
|
|
54589
|
+
{
|
|
54590
|
+
metaTokens: true,
|
|
54591
|
+
dots: false,
|
|
54592
|
+
indexes: false,
|
|
54593
|
+
},
|
|
54594
|
+
false,
|
|
54595
|
+
function defined(option, source) {
|
|
54596
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
54597
|
+
return !utils$1.isUndefined(source[option]);
|
|
54942
54598
|
}
|
|
54599
|
+
);
|
|
54943
54600
|
|
|
54944
|
-
|
|
54601
|
+
const metaTokens = options.metaTokens;
|
|
54602
|
+
// eslint-disable-next-line no-use-before-define
|
|
54603
|
+
const visitor = options.visitor || defaultVisitor;
|
|
54604
|
+
const dots = options.dots;
|
|
54605
|
+
const indexes = options.indexes;
|
|
54606
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
54607
|
+
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
54608
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
54609
|
+
|
|
54610
|
+
if (!utils$1.isFunction(visitor)) {
|
|
54611
|
+
throw new TypeError('visitor must be a function');
|
|
54945
54612
|
}
|
|
54946
54613
|
|
|
54947
|
-
|
|
54948
|
-
|
|
54614
|
+
function convertValue(value) {
|
|
54615
|
+
if (value === null) return '';
|
|
54949
54616
|
|
|
54950
|
-
if (
|
|
54951
|
-
|
|
54617
|
+
if (utils$1.isDate(value)) {
|
|
54618
|
+
return value.toISOString();
|
|
54952
54619
|
}
|
|
54953
54620
|
|
|
54954
|
-
|
|
54955
|
-
|
|
54621
|
+
if (utils$1.isBoolean(value)) {
|
|
54622
|
+
return value.toString();
|
|
54623
|
+
}
|
|
54956
54624
|
|
|
54957
|
-
|
|
54958
|
-
|
|
54625
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
54626
|
+
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
54627
|
+
}
|
|
54959
54628
|
|
|
54960
|
-
|
|
54961
|
-
|
|
54962
|
-
|
|
54963
|
-
// eslint-disable-next-line no-control-regex
|
|
54964
|
-
const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
|
|
54629
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
54630
|
+
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
54631
|
+
}
|
|
54965
54632
|
|
|
54966
|
-
|
|
54967
|
-
if (utils$1.isArray(value)) {
|
|
54968
|
-
return value.map((item) => sanitizeValue(item, invalidChars));
|
|
54633
|
+
return value;
|
|
54969
54634
|
}
|
|
54970
54635
|
|
|
54971
|
-
|
|
54972
|
-
|
|
54973
|
-
|
|
54974
|
-
|
|
54975
|
-
|
|
54976
|
-
|
|
54977
|
-
|
|
54978
|
-
|
|
54636
|
+
/**
|
|
54637
|
+
* Default visitor.
|
|
54638
|
+
*
|
|
54639
|
+
* @param {*} value
|
|
54640
|
+
* @param {String|Number} key
|
|
54641
|
+
* @param {Array<String|Number>} path
|
|
54642
|
+
* @this {FormData}
|
|
54643
|
+
*
|
|
54644
|
+
* @returns {boolean} return true to visit the each prop of the value recursively
|
|
54645
|
+
*/
|
|
54646
|
+
function defaultVisitor(value, key, path) {
|
|
54647
|
+
let arr = value;
|
|
54979
54648
|
|
|
54980
|
-
|
|
54981
|
-
|
|
54649
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
54650
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
54651
|
+
return false;
|
|
54652
|
+
}
|
|
54982
54653
|
|
|
54983
|
-
|
|
54984
|
-
|
|
54985
|
-
|
|
54654
|
+
if (value && !path && typeof value === 'object') {
|
|
54655
|
+
if (utils$1.endsWith(key, '{}')) {
|
|
54656
|
+
// eslint-disable-next-line no-param-reassign
|
|
54657
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
54658
|
+
// eslint-disable-next-line no-param-reassign
|
|
54659
|
+
value = JSON.stringify(value);
|
|
54660
|
+
} else if (
|
|
54661
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
54662
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
54663
|
+
) {
|
|
54664
|
+
// eslint-disable-next-line no-param-reassign
|
|
54665
|
+
key = removeBrackets(key);
|
|
54986
54666
|
|
|
54987
|
-
|
|
54988
|
-
|
|
54667
|
+
arr.forEach(function each(el, index) {
|
|
54668
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
54669
|
+
formData.append(
|
|
54670
|
+
// eslint-disable-next-line no-nested-ternary
|
|
54671
|
+
indexes === true
|
|
54672
|
+
? renderKey([key], index, dots)
|
|
54673
|
+
: indexes === null
|
|
54674
|
+
? key
|
|
54675
|
+
: key + '[]',
|
|
54676
|
+
convertValue(el)
|
|
54677
|
+
);
|
|
54678
|
+
});
|
|
54679
|
+
return false;
|
|
54680
|
+
}
|
|
54681
|
+
}
|
|
54989
54682
|
|
|
54990
|
-
|
|
54683
|
+
if (isVisitable(value)) {
|
|
54684
|
+
return true;
|
|
54685
|
+
}
|
|
54991
54686
|
|
|
54992
|
-
|
|
54993
|
-
return header && String(header).trim().toLowerCase();
|
|
54994
|
-
}
|
|
54687
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
54995
54688
|
|
|
54996
|
-
|
|
54997
|
-
if (value === false || value == null) {
|
|
54998
|
-
return value;
|
|
54689
|
+
return false;
|
|
54999
54690
|
}
|
|
55000
54691
|
|
|
55001
|
-
|
|
55002
|
-
}
|
|
54692
|
+
const stack = [];
|
|
55003
54693
|
|
|
55004
|
-
|
|
55005
|
-
|
|
55006
|
-
|
|
55007
|
-
|
|
54694
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
54695
|
+
defaultVisitor,
|
|
54696
|
+
convertValue,
|
|
54697
|
+
isVisitable,
|
|
54698
|
+
});
|
|
55008
54699
|
|
|
55009
|
-
|
|
55010
|
-
|
|
55011
|
-
}
|
|
54700
|
+
function build(value, path, depth = 0) {
|
|
54701
|
+
if (utils$1.isUndefined(value)) return;
|
|
55012
54702
|
|
|
55013
|
-
|
|
55014
|
-
|
|
54703
|
+
if (depth > maxDepth) {
|
|
54704
|
+
throw new AxiosError(
|
|
54705
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
54706
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
54707
|
+
);
|
|
54708
|
+
}
|
|
55015
54709
|
|
|
55016
|
-
|
|
54710
|
+
if (stack.indexOf(value) !== -1) {
|
|
54711
|
+
throw Error('Circular reference detected in ' + path.join('.'));
|
|
54712
|
+
}
|
|
55017
54713
|
|
|
55018
|
-
|
|
55019
|
-
if (utils$1.isFunction(filter)) {
|
|
55020
|
-
return filter.call(this, value, header);
|
|
55021
|
-
}
|
|
54714
|
+
stack.push(value);
|
|
55022
54715
|
|
|
55023
|
-
|
|
55024
|
-
|
|
55025
|
-
|
|
54716
|
+
utils$1.forEach(value, function each(el, key) {
|
|
54717
|
+
const result =
|
|
54718
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
54719
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
55026
54720
|
|
|
55027
|
-
|
|
54721
|
+
if (result === true) {
|
|
54722
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
54723
|
+
}
|
|
54724
|
+
});
|
|
55028
54725
|
|
|
55029
|
-
|
|
55030
|
-
return value.indexOf(filter) !== -1;
|
|
54726
|
+
stack.pop();
|
|
55031
54727
|
}
|
|
55032
54728
|
|
|
55033
|
-
if (utils$1.
|
|
55034
|
-
|
|
54729
|
+
if (!utils$1.isObject(obj)) {
|
|
54730
|
+
throw new TypeError('data must be an object');
|
|
55035
54731
|
}
|
|
55036
|
-
}
|
|
55037
54732
|
|
|
55038
|
-
|
|
55039
|
-
return header
|
|
55040
|
-
.trim()
|
|
55041
|
-
.toLowerCase()
|
|
55042
|
-
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
55043
|
-
return char.toUpperCase() + str;
|
|
55044
|
-
});
|
|
55045
|
-
}
|
|
54733
|
+
build(obj);
|
|
55046
54734
|
|
|
55047
|
-
|
|
55048
|
-
|
|
55049
|
-
|
|
55050
|
-
['get', 'set', 'has'].forEach((methodName) => {
|
|
55051
|
-
Object.defineProperty(obj, methodName + accessorName, {
|
|
55052
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
55053
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
55054
|
-
__proto__: null,
|
|
55055
|
-
value: function (arg1, arg2, arg3) {
|
|
55056
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
55057
|
-
},
|
|
55058
|
-
configurable: true,
|
|
55059
|
-
});
|
|
55060
|
-
});
|
|
55061
|
-
}
|
|
55062
|
-
|
|
55063
|
-
class AxiosHeaders {
|
|
55064
|
-
constructor(headers) {
|
|
55065
|
-
headers && this.set(headers);
|
|
55066
|
-
}
|
|
55067
|
-
|
|
55068
|
-
set(header, valueOrRewrite, rewrite) {
|
|
55069
|
-
const self = this;
|
|
55070
|
-
|
|
55071
|
-
function setHeader(_value, _header, _rewrite) {
|
|
55072
|
-
const lHeader = normalizeHeader(_header);
|
|
55073
|
-
|
|
55074
|
-
if (!lHeader) {
|
|
55075
|
-
throw new Error('header name must be a non-empty string');
|
|
55076
|
-
}
|
|
55077
|
-
|
|
55078
|
-
const key = utils$1.findKey(self, lHeader);
|
|
55079
|
-
|
|
55080
|
-
if (
|
|
55081
|
-
!key ||
|
|
55082
|
-
self[key] === undefined ||
|
|
55083
|
-
_rewrite === true ||
|
|
55084
|
-
(_rewrite === undefined && self[key] !== false)
|
|
55085
|
-
) {
|
|
55086
|
-
self[key || _header] = normalizeValue(_value);
|
|
55087
|
-
}
|
|
55088
|
-
}
|
|
55089
|
-
|
|
55090
|
-
const setHeaders = (headers, _rewrite) =>
|
|
55091
|
-
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
55092
|
-
|
|
55093
|
-
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
55094
|
-
setHeaders(header, valueOrRewrite);
|
|
55095
|
-
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
55096
|
-
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
55097
|
-
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
55098
|
-
let obj = {},
|
|
55099
|
-
dest,
|
|
55100
|
-
key;
|
|
55101
|
-
for (const entry of header) {
|
|
55102
|
-
if (!utils$1.isArray(entry)) {
|
|
55103
|
-
throw TypeError('Object iterator must return a key-value pair');
|
|
55104
|
-
}
|
|
55105
|
-
|
|
55106
|
-
obj[(key = entry[0])] = (dest = obj[key])
|
|
55107
|
-
? utils$1.isArray(dest)
|
|
55108
|
-
? [...dest, entry[1]]
|
|
55109
|
-
: [dest, entry[1]]
|
|
55110
|
-
: entry[1];
|
|
55111
|
-
}
|
|
55112
|
-
|
|
55113
|
-
setHeaders(obj, valueOrRewrite);
|
|
55114
|
-
} else {
|
|
55115
|
-
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
55116
|
-
}
|
|
55117
|
-
|
|
55118
|
-
return this;
|
|
55119
|
-
}
|
|
55120
|
-
|
|
55121
|
-
get(header, parser) {
|
|
55122
|
-
header = normalizeHeader(header);
|
|
55123
|
-
|
|
55124
|
-
if (header) {
|
|
55125
|
-
const key = utils$1.findKey(this, header);
|
|
55126
|
-
|
|
55127
|
-
if (key) {
|
|
55128
|
-
const value = this[key];
|
|
55129
|
-
|
|
55130
|
-
if (!parser) {
|
|
55131
|
-
return value;
|
|
55132
|
-
}
|
|
55133
|
-
|
|
55134
|
-
if (parser === true) {
|
|
55135
|
-
return parseTokens(value);
|
|
55136
|
-
}
|
|
55137
|
-
|
|
55138
|
-
if (utils$1.isFunction(parser)) {
|
|
55139
|
-
return parser.call(this, value, key);
|
|
55140
|
-
}
|
|
55141
|
-
|
|
55142
|
-
if (utils$1.isRegExp(parser)) {
|
|
55143
|
-
return parser.exec(value);
|
|
55144
|
-
}
|
|
55145
|
-
|
|
55146
|
-
throw new TypeError('parser must be boolean|regexp|function');
|
|
55147
|
-
}
|
|
55148
|
-
}
|
|
55149
|
-
}
|
|
55150
|
-
|
|
55151
|
-
has(header, matcher) {
|
|
55152
|
-
header = normalizeHeader(header);
|
|
55153
|
-
|
|
55154
|
-
if (header) {
|
|
55155
|
-
const key = utils$1.findKey(this, header);
|
|
55156
|
-
|
|
55157
|
-
return !!(
|
|
55158
|
-
key &&
|
|
55159
|
-
this[key] !== undefined &&
|
|
55160
|
-
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
55161
|
-
);
|
|
55162
|
-
}
|
|
55163
|
-
|
|
55164
|
-
return false;
|
|
55165
|
-
}
|
|
55166
|
-
|
|
55167
|
-
delete(header, matcher) {
|
|
55168
|
-
const self = this;
|
|
55169
|
-
let deleted = false;
|
|
55170
|
-
|
|
55171
|
-
function deleteHeader(_header) {
|
|
55172
|
-
_header = normalizeHeader(_header);
|
|
55173
|
-
|
|
55174
|
-
if (_header) {
|
|
55175
|
-
const key = utils$1.findKey(self, _header);
|
|
55176
|
-
|
|
55177
|
-
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
55178
|
-
delete self[key];
|
|
55179
|
-
|
|
55180
|
-
deleted = true;
|
|
55181
|
-
}
|
|
55182
|
-
}
|
|
55183
|
-
}
|
|
55184
|
-
|
|
55185
|
-
if (utils$1.isArray(header)) {
|
|
55186
|
-
header.forEach(deleteHeader);
|
|
55187
|
-
} else {
|
|
55188
|
-
deleteHeader(header);
|
|
55189
|
-
}
|
|
55190
|
-
|
|
55191
|
-
return deleted;
|
|
55192
|
-
}
|
|
55193
|
-
|
|
55194
|
-
clear(matcher) {
|
|
55195
|
-
const keys = Object.keys(this);
|
|
55196
|
-
let i = keys.length;
|
|
55197
|
-
let deleted = false;
|
|
55198
|
-
|
|
55199
|
-
while (i--) {
|
|
55200
|
-
const key = keys[i];
|
|
55201
|
-
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
55202
|
-
delete this[key];
|
|
55203
|
-
deleted = true;
|
|
55204
|
-
}
|
|
55205
|
-
}
|
|
55206
|
-
|
|
55207
|
-
return deleted;
|
|
55208
|
-
}
|
|
55209
|
-
|
|
55210
|
-
normalize(format) {
|
|
55211
|
-
const self = this;
|
|
55212
|
-
const headers = {};
|
|
55213
|
-
|
|
55214
|
-
utils$1.forEach(this, (value, header) => {
|
|
55215
|
-
const key = utils$1.findKey(headers, header);
|
|
55216
|
-
|
|
55217
|
-
if (key) {
|
|
55218
|
-
self[key] = normalizeValue(value);
|
|
55219
|
-
delete self[header];
|
|
55220
|
-
return;
|
|
55221
|
-
}
|
|
55222
|
-
|
|
55223
|
-
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
55224
|
-
|
|
55225
|
-
if (normalized !== header) {
|
|
55226
|
-
delete self[header];
|
|
55227
|
-
}
|
|
55228
|
-
|
|
55229
|
-
self[normalized] = normalizeValue(value);
|
|
55230
|
-
|
|
55231
|
-
headers[normalized] = true;
|
|
55232
|
-
});
|
|
55233
|
-
|
|
55234
|
-
return this;
|
|
55235
|
-
}
|
|
55236
|
-
|
|
55237
|
-
concat(...targets) {
|
|
55238
|
-
return this.constructor.concat(this, ...targets);
|
|
55239
|
-
}
|
|
55240
|
-
|
|
55241
|
-
toJSON(asStrings) {
|
|
55242
|
-
const obj = Object.create(null);
|
|
55243
|
-
|
|
55244
|
-
utils$1.forEach(this, (value, header) => {
|
|
55245
|
-
value != null &&
|
|
55246
|
-
value !== false &&
|
|
55247
|
-
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
55248
|
-
});
|
|
55249
|
-
|
|
55250
|
-
return obj;
|
|
55251
|
-
}
|
|
55252
|
-
|
|
55253
|
-
[Symbol.iterator]() {
|
|
55254
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
55255
|
-
}
|
|
55256
|
-
|
|
55257
|
-
toString() {
|
|
55258
|
-
return Object.entries(this.toJSON())
|
|
55259
|
-
.map(([header, value]) => header + ': ' + value)
|
|
55260
|
-
.join('\n');
|
|
55261
|
-
}
|
|
55262
|
-
|
|
55263
|
-
getSetCookie() {
|
|
55264
|
-
return this.get('set-cookie') || [];
|
|
55265
|
-
}
|
|
55266
|
-
|
|
55267
|
-
get [Symbol.toStringTag]() {
|
|
55268
|
-
return 'AxiosHeaders';
|
|
55269
|
-
}
|
|
55270
|
-
|
|
55271
|
-
static from(thing) {
|
|
55272
|
-
return thing instanceof this ? thing : new this(thing);
|
|
55273
|
-
}
|
|
55274
|
-
|
|
55275
|
-
static concat(first, ...targets) {
|
|
55276
|
-
const computed = new this(first);
|
|
55277
|
-
|
|
55278
|
-
targets.forEach((target) => computed.set(target));
|
|
55279
|
-
|
|
55280
|
-
return computed;
|
|
55281
|
-
}
|
|
55282
|
-
|
|
55283
|
-
static accessor(header) {
|
|
55284
|
-
const internals =
|
|
55285
|
-
(this[$internals] =
|
|
55286
|
-
this[$internals] =
|
|
55287
|
-
{
|
|
55288
|
-
accessors: {},
|
|
55289
|
-
});
|
|
55290
|
-
|
|
55291
|
-
const accessors = internals.accessors;
|
|
55292
|
-
const prototype = this.prototype;
|
|
55293
|
-
|
|
55294
|
-
function defineAccessor(_header) {
|
|
55295
|
-
const lHeader = normalizeHeader(_header);
|
|
55296
|
-
|
|
55297
|
-
if (!accessors[lHeader]) {
|
|
55298
|
-
buildAccessors(prototype, _header);
|
|
55299
|
-
accessors[lHeader] = true;
|
|
55300
|
-
}
|
|
55301
|
-
}
|
|
55302
|
-
|
|
55303
|
-
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
55304
|
-
|
|
55305
|
-
return this;
|
|
55306
|
-
}
|
|
55307
|
-
}
|
|
55308
|
-
|
|
55309
|
-
AxiosHeaders.accessor([
|
|
55310
|
-
'Content-Type',
|
|
55311
|
-
'Content-Length',
|
|
55312
|
-
'Accept',
|
|
55313
|
-
'Accept-Encoding',
|
|
55314
|
-
'User-Agent',
|
|
55315
|
-
'Authorization',
|
|
55316
|
-
]);
|
|
55317
|
-
|
|
55318
|
-
// reserved names hotfix
|
|
55319
|
-
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
55320
|
-
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
55321
|
-
return {
|
|
55322
|
-
get: () => value,
|
|
55323
|
-
set(headerValue) {
|
|
55324
|
-
this[mapped] = headerValue;
|
|
55325
|
-
},
|
|
55326
|
-
};
|
|
55327
|
-
});
|
|
55328
|
-
|
|
55329
|
-
utils$1.freezeMethods(AxiosHeaders);
|
|
55330
|
-
|
|
55331
|
-
const REDACTED = '[REDACTED ****]';
|
|
55332
|
-
|
|
55333
|
-
function hasOwnOrPrototypeToJSON(source) {
|
|
55334
|
-
if (utils$1.hasOwnProp(source, 'toJSON')) {
|
|
55335
|
-
return true;
|
|
55336
|
-
}
|
|
55337
|
-
|
|
55338
|
-
let prototype = Object.getPrototypeOf(source);
|
|
55339
|
-
|
|
55340
|
-
while (prototype && prototype !== Object.prototype) {
|
|
55341
|
-
if (utils$1.hasOwnProp(prototype, 'toJSON')) {
|
|
55342
|
-
return true;
|
|
55343
|
-
}
|
|
55344
|
-
|
|
55345
|
-
prototype = Object.getPrototypeOf(prototype);
|
|
55346
|
-
}
|
|
55347
|
-
|
|
55348
|
-
return false;
|
|
55349
|
-
}
|
|
55350
|
-
|
|
55351
|
-
// Build a plain-object snapshot of `config` and replace the value of any key
|
|
55352
|
-
// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
|
|
55353
|
-
// and AxiosHeaders, and short-circuits on circular references.
|
|
55354
|
-
function redactConfig(config, redactKeys) {
|
|
55355
|
-
const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
|
|
55356
|
-
const seen = [];
|
|
55357
|
-
|
|
55358
|
-
const visit = (source) => {
|
|
55359
|
-
if (source === null || typeof source !== 'object') return source;
|
|
55360
|
-
if (utils$1.isBuffer(source)) return source;
|
|
55361
|
-
if (seen.indexOf(source) !== -1) return undefined;
|
|
55362
|
-
|
|
55363
|
-
if (source instanceof AxiosHeaders) {
|
|
55364
|
-
source = source.toJSON();
|
|
55365
|
-
}
|
|
55366
|
-
|
|
55367
|
-
seen.push(source);
|
|
55368
|
-
|
|
55369
|
-
let result;
|
|
55370
|
-
if (utils$1.isArray(source)) {
|
|
55371
|
-
result = [];
|
|
55372
|
-
source.forEach((v, i) => {
|
|
55373
|
-
const reducedValue = visit(v);
|
|
55374
|
-
if (!utils$1.isUndefined(reducedValue)) {
|
|
55375
|
-
result[i] = reducedValue;
|
|
55376
|
-
}
|
|
55377
|
-
});
|
|
55378
|
-
} else {
|
|
55379
|
-
if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
|
|
55380
|
-
seen.pop();
|
|
55381
|
-
return source;
|
|
55382
|
-
}
|
|
55383
|
-
|
|
55384
|
-
result = Object.create(null);
|
|
55385
|
-
for (const [key, value] of Object.entries(source)) {
|
|
55386
|
-
const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
|
|
55387
|
-
if (!utils$1.isUndefined(reducedValue)) {
|
|
55388
|
-
result[key] = reducedValue;
|
|
55389
|
-
}
|
|
55390
|
-
}
|
|
55391
|
-
}
|
|
55392
|
-
|
|
55393
|
-
seen.pop();
|
|
55394
|
-
return result;
|
|
55395
|
-
};
|
|
55396
|
-
|
|
55397
|
-
return visit(config);
|
|
55398
|
-
}
|
|
55399
|
-
|
|
55400
|
-
class AxiosError extends Error {
|
|
55401
|
-
static from(error, code, config, request, response, customProps) {
|
|
55402
|
-
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
55403
|
-
axiosError.cause = error;
|
|
55404
|
-
axiosError.name = error.name;
|
|
55405
|
-
|
|
55406
|
-
// Preserve status from the original error if not already set from response
|
|
55407
|
-
if (error.status != null && axiosError.status == null) {
|
|
55408
|
-
axiosError.status = error.status;
|
|
55409
|
-
}
|
|
55410
|
-
|
|
55411
|
-
customProps && Object.assign(axiosError, customProps);
|
|
55412
|
-
return axiosError;
|
|
55413
|
-
}
|
|
55414
|
-
|
|
55415
|
-
/**
|
|
55416
|
-
* Create an Error with the specified message, config, error code, request and response.
|
|
55417
|
-
*
|
|
55418
|
-
* @param {string} message The error message.
|
|
55419
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
55420
|
-
* @param {Object} [config] The config.
|
|
55421
|
-
* @param {Object} [request] The request.
|
|
55422
|
-
* @param {Object} [response] The response.
|
|
55423
|
-
*
|
|
55424
|
-
* @returns {Error} The created error.
|
|
55425
|
-
*/
|
|
55426
|
-
constructor(message, code, config, request, response) {
|
|
55427
|
-
super(message);
|
|
55428
|
-
|
|
55429
|
-
// Make message enumerable to maintain backward compatibility
|
|
55430
|
-
// The native Error constructor sets message as non-enumerable,
|
|
55431
|
-
// but axios < v1.13.3 had it as enumerable
|
|
55432
|
-
Object.defineProperty(this, 'message', {
|
|
55433
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
55434
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
55435
|
-
__proto__: null,
|
|
55436
|
-
value: message,
|
|
55437
|
-
enumerable: true,
|
|
55438
|
-
writable: true,
|
|
55439
|
-
configurable: true,
|
|
55440
|
-
});
|
|
55441
|
-
|
|
55442
|
-
this.name = 'AxiosError';
|
|
55443
|
-
this.isAxiosError = true;
|
|
55444
|
-
code && (this.code = code);
|
|
55445
|
-
config && (this.config = config);
|
|
55446
|
-
request && (this.request = request);
|
|
55447
|
-
if (response) {
|
|
55448
|
-
this.response = response;
|
|
55449
|
-
this.status = response.status;
|
|
55450
|
-
}
|
|
55451
|
-
}
|
|
55452
|
-
|
|
55453
|
-
toJSON() {
|
|
55454
|
-
// Opt-in redaction: when the request config carries a `redact` array, the
|
|
55455
|
-
// value of any matching key (case-insensitive, at any depth) is replaced
|
|
55456
|
-
// with REDACTED in the serialized snapshot. Undefined or empty leaves the
|
|
55457
|
-
// existing serialization behavior unchanged.
|
|
55458
|
-
const config = this.config;
|
|
55459
|
-
const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
|
|
55460
|
-
const serializedConfig =
|
|
55461
|
-
utils$1.isArray(redactKeys) && redactKeys.length > 0
|
|
55462
|
-
? redactConfig(config, redactKeys)
|
|
55463
|
-
: utils$1.toJSONObject(config);
|
|
55464
|
-
|
|
55465
|
-
return {
|
|
55466
|
-
// Standard
|
|
55467
|
-
message: this.message,
|
|
55468
|
-
name: this.name,
|
|
55469
|
-
// Microsoft
|
|
55470
|
-
description: this.description,
|
|
55471
|
-
number: this.number,
|
|
55472
|
-
// Mozilla
|
|
55473
|
-
fileName: this.fileName,
|
|
55474
|
-
lineNumber: this.lineNumber,
|
|
55475
|
-
columnNumber: this.columnNumber,
|
|
55476
|
-
stack: this.stack,
|
|
55477
|
-
// Axios
|
|
55478
|
-
config: serializedConfig,
|
|
55479
|
-
code: this.code,
|
|
55480
|
-
status: this.status,
|
|
55481
|
-
};
|
|
55482
|
-
}
|
|
55483
|
-
}
|
|
55484
|
-
|
|
55485
|
-
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
55486
|
-
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
55487
|
-
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
55488
|
-
AxiosError.ECONNABORTED = 'ECONNABORTED';
|
|
55489
|
-
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
|
|
55490
|
-
AxiosError.ECONNREFUSED = 'ECONNREFUSED';
|
|
55491
|
-
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
|
|
55492
|
-
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
55493
|
-
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
55494
|
-
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
55495
|
-
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
55496
|
-
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
55497
|
-
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
55498
|
-
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
55499
|
-
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
55500
|
-
|
|
55501
|
-
// eslint-disable-next-line strict
|
|
55502
|
-
var httpAdapter = null;
|
|
55503
|
-
|
|
55504
|
-
/**
|
|
55505
|
-
* Determines if the given thing is a array or js object.
|
|
55506
|
-
*
|
|
55507
|
-
* @param {string} thing - The object or array to be visited.
|
|
55508
|
-
*
|
|
55509
|
-
* @returns {boolean}
|
|
55510
|
-
*/
|
|
55511
|
-
function isVisitable(thing) {
|
|
55512
|
-
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
55513
|
-
}
|
|
55514
|
-
|
|
55515
|
-
/**
|
|
55516
|
-
* It removes the brackets from the end of a string
|
|
55517
|
-
*
|
|
55518
|
-
* @param {string} key - The key of the parameter.
|
|
55519
|
-
*
|
|
55520
|
-
* @returns {string} the key without the brackets.
|
|
55521
|
-
*/
|
|
55522
|
-
function removeBrackets(key) {
|
|
55523
|
-
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
55524
|
-
}
|
|
55525
|
-
|
|
55526
|
-
/**
|
|
55527
|
-
* It takes a path, a key, and a boolean, and returns a string
|
|
55528
|
-
*
|
|
55529
|
-
* @param {string} path - The path to the current key.
|
|
55530
|
-
* @param {string} key - The key of the current object being iterated over.
|
|
55531
|
-
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
55532
|
-
*
|
|
55533
|
-
* @returns {string} The path to the current key.
|
|
55534
|
-
*/
|
|
55535
|
-
function renderKey(path, key, dots) {
|
|
55536
|
-
if (!path) return key;
|
|
55537
|
-
return path
|
|
55538
|
-
.concat(key)
|
|
55539
|
-
.map(function each(token, i) {
|
|
55540
|
-
// eslint-disable-next-line no-param-reassign
|
|
55541
|
-
token = removeBrackets(token);
|
|
55542
|
-
return !dots && i ? '[' + token + ']' : token;
|
|
55543
|
-
})
|
|
55544
|
-
.join(dots ? '.' : '');
|
|
55545
|
-
}
|
|
55546
|
-
|
|
55547
|
-
/**
|
|
55548
|
-
* If the array is an array and none of its elements are visitable, then it's a flat array.
|
|
55549
|
-
*
|
|
55550
|
-
* @param {Array<any>} arr - The array to check
|
|
55551
|
-
*
|
|
55552
|
-
* @returns {boolean}
|
|
55553
|
-
*/
|
|
55554
|
-
function isFlatArray(arr) {
|
|
55555
|
-
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
55556
|
-
}
|
|
55557
|
-
|
|
55558
|
-
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
55559
|
-
return /^is[A-Z]/.test(prop);
|
|
55560
|
-
});
|
|
55561
|
-
|
|
55562
|
-
/**
|
|
55563
|
-
* Convert a data object to FormData
|
|
55564
|
-
*
|
|
55565
|
-
* @param {Object} obj
|
|
55566
|
-
* @param {?Object} [formData]
|
|
55567
|
-
* @param {?Object} [options]
|
|
55568
|
-
* @param {Function} [options.visitor]
|
|
55569
|
-
* @param {Boolean} [options.metaTokens = true]
|
|
55570
|
-
* @param {Boolean} [options.dots = false]
|
|
55571
|
-
* @param {?Boolean} [options.indexes = false]
|
|
55572
|
-
*
|
|
55573
|
-
* @returns {Object}
|
|
55574
|
-
**/
|
|
55575
|
-
|
|
55576
|
-
/**
|
|
55577
|
-
* It converts an object into a FormData object
|
|
55578
|
-
*
|
|
55579
|
-
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
55580
|
-
* @param {string} formData - The FormData object to append to.
|
|
55581
|
-
* @param {Object<string, any>} options
|
|
55582
|
-
*
|
|
55583
|
-
* @returns
|
|
55584
|
-
*/
|
|
55585
|
-
function toFormData(obj, formData, options) {
|
|
55586
|
-
if (!utils$1.isObject(obj)) {
|
|
55587
|
-
throw new TypeError('target must be an object');
|
|
55588
|
-
}
|
|
55589
|
-
|
|
55590
|
-
// eslint-disable-next-line no-param-reassign
|
|
55591
|
-
formData = formData || new (FormData)();
|
|
55592
|
-
|
|
55593
|
-
// eslint-disable-next-line no-param-reassign
|
|
55594
|
-
options = utils$1.toFlatObject(
|
|
55595
|
-
options,
|
|
55596
|
-
{
|
|
55597
|
-
metaTokens: true,
|
|
55598
|
-
dots: false,
|
|
55599
|
-
indexes: false,
|
|
55600
|
-
},
|
|
55601
|
-
false,
|
|
55602
|
-
function defined(option, source) {
|
|
55603
|
-
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
55604
|
-
return !utils$1.isUndefined(source[option]);
|
|
55605
|
-
}
|
|
55606
|
-
);
|
|
55607
|
-
|
|
55608
|
-
const metaTokens = options.metaTokens;
|
|
55609
|
-
// eslint-disable-next-line no-use-before-define
|
|
55610
|
-
const visitor = options.visitor || defaultVisitor;
|
|
55611
|
-
const dots = options.dots;
|
|
55612
|
-
const indexes = options.indexes;
|
|
55613
|
-
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
55614
|
-
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
55615
|
-
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
55616
|
-
|
|
55617
|
-
if (!utils$1.isFunction(visitor)) {
|
|
55618
|
-
throw new TypeError('visitor must be a function');
|
|
55619
|
-
}
|
|
55620
|
-
|
|
55621
|
-
function convertValue(value) {
|
|
55622
|
-
if (value === null) return '';
|
|
55623
|
-
|
|
55624
|
-
if (utils$1.isDate(value)) {
|
|
55625
|
-
return value.toISOString();
|
|
55626
|
-
}
|
|
55627
|
-
|
|
55628
|
-
if (utils$1.isBoolean(value)) {
|
|
55629
|
-
return value.toString();
|
|
55630
|
-
}
|
|
55631
|
-
|
|
55632
|
-
if (!useBlob && utils$1.isBlob(value)) {
|
|
55633
|
-
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
55634
|
-
}
|
|
55635
|
-
|
|
55636
|
-
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
55637
|
-
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
55638
|
-
}
|
|
55639
|
-
|
|
55640
|
-
return value;
|
|
55641
|
-
}
|
|
55642
|
-
|
|
55643
|
-
/**
|
|
55644
|
-
* Default visitor.
|
|
55645
|
-
*
|
|
55646
|
-
* @param {*} value
|
|
55647
|
-
* @param {String|Number} key
|
|
55648
|
-
* @param {Array<String|Number>} path
|
|
55649
|
-
* @this {FormData}
|
|
55650
|
-
*
|
|
55651
|
-
* @returns {boolean} return true to visit the each prop of the value recursively
|
|
55652
|
-
*/
|
|
55653
|
-
function defaultVisitor(value, key, path) {
|
|
55654
|
-
let arr = value;
|
|
55655
|
-
|
|
55656
|
-
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
55657
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
55658
|
-
return false;
|
|
55659
|
-
}
|
|
55660
|
-
|
|
55661
|
-
if (value && !path && typeof value === 'object') {
|
|
55662
|
-
if (utils$1.endsWith(key, '{}')) {
|
|
55663
|
-
// eslint-disable-next-line no-param-reassign
|
|
55664
|
-
key = metaTokens ? key : key.slice(0, -2);
|
|
55665
|
-
// eslint-disable-next-line no-param-reassign
|
|
55666
|
-
value = JSON.stringify(value);
|
|
55667
|
-
} else if (
|
|
55668
|
-
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
55669
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
55670
|
-
) {
|
|
55671
|
-
// eslint-disable-next-line no-param-reassign
|
|
55672
|
-
key = removeBrackets(key);
|
|
55673
|
-
|
|
55674
|
-
arr.forEach(function each(el, index) {
|
|
55675
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
55676
|
-
formData.append(
|
|
55677
|
-
// eslint-disable-next-line no-nested-ternary
|
|
55678
|
-
indexes === true
|
|
55679
|
-
? renderKey([key], index, dots)
|
|
55680
|
-
: indexes === null
|
|
55681
|
-
? key
|
|
55682
|
-
: key + '[]',
|
|
55683
|
-
convertValue(el)
|
|
55684
|
-
);
|
|
55685
|
-
});
|
|
55686
|
-
return false;
|
|
55687
|
-
}
|
|
55688
|
-
}
|
|
55689
|
-
|
|
55690
|
-
if (isVisitable(value)) {
|
|
55691
|
-
return true;
|
|
55692
|
-
}
|
|
55693
|
-
|
|
55694
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
55695
|
-
|
|
55696
|
-
return false;
|
|
55697
|
-
}
|
|
55698
|
-
|
|
55699
|
-
const stack = [];
|
|
55700
|
-
|
|
55701
|
-
const exposedHelpers = Object.assign(predicates, {
|
|
55702
|
-
defaultVisitor,
|
|
55703
|
-
convertValue,
|
|
55704
|
-
isVisitable,
|
|
55705
|
-
});
|
|
55706
|
-
|
|
55707
|
-
function build(value, path, depth = 0) {
|
|
55708
|
-
if (utils$1.isUndefined(value)) return;
|
|
55709
|
-
|
|
55710
|
-
if (depth > maxDepth) {
|
|
55711
|
-
throw new AxiosError(
|
|
55712
|
-
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
55713
|
-
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
55714
|
-
);
|
|
55715
|
-
}
|
|
55716
|
-
|
|
55717
|
-
if (stack.indexOf(value) !== -1) {
|
|
55718
|
-
throw Error('Circular reference detected in ' + path.join('.'));
|
|
55719
|
-
}
|
|
55720
|
-
|
|
55721
|
-
stack.push(value);
|
|
55722
|
-
|
|
55723
|
-
utils$1.forEach(value, function each(el, key) {
|
|
55724
|
-
const result =
|
|
55725
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
55726
|
-
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
55727
|
-
|
|
55728
|
-
if (result === true) {
|
|
55729
|
-
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
55730
|
-
}
|
|
55731
|
-
});
|
|
55732
|
-
|
|
55733
|
-
stack.pop();
|
|
55734
|
-
}
|
|
55735
|
-
|
|
55736
|
-
if (!utils$1.isObject(obj)) {
|
|
55737
|
-
throw new TypeError('data must be an object');
|
|
55738
|
-
}
|
|
55739
|
-
|
|
55740
|
-
build(obj);
|
|
55741
|
-
|
|
55742
|
-
return formData;
|
|
55743
|
-
}
|
|
54735
|
+
return formData;
|
|
54736
|
+
}
|
|
55744
54737
|
|
|
55745
54738
|
/**
|
|
55746
54739
|
* It encodes a string by replacing all characters that are not in the unreserved set with
|
|
@@ -56060,227 +55053,664 @@ function arrayToObject(arr) {
|
|
|
56060
55053
|
return obj;
|
|
56061
55054
|
}
|
|
56062
55055
|
|
|
56063
|
-
/**
|
|
56064
|
-
* It takes a FormData object and returns a JavaScript object
|
|
56065
|
-
*
|
|
56066
|
-
* @param {string} formData The FormData object to convert to JSON.
|
|
56067
|
-
*
|
|
56068
|
-
* @returns {Object<string, any> | null} The converted object.
|
|
56069
|
-
*/
|
|
56070
|
-
function formDataToJSON(formData) {
|
|
56071
|
-
function buildPath(path, value, target, index) {
|
|
56072
|
-
let name = path[index++];
|
|
55056
|
+
/**
|
|
55057
|
+
* It takes a FormData object and returns a JavaScript object
|
|
55058
|
+
*
|
|
55059
|
+
* @param {string} formData The FormData object to convert to JSON.
|
|
55060
|
+
*
|
|
55061
|
+
* @returns {Object<string, any> | null} The converted object.
|
|
55062
|
+
*/
|
|
55063
|
+
function formDataToJSON(formData) {
|
|
55064
|
+
function buildPath(path, value, target, index) {
|
|
55065
|
+
let name = path[index++];
|
|
55066
|
+
|
|
55067
|
+
if (name === '__proto__') return true;
|
|
55068
|
+
|
|
55069
|
+
const isNumericKey = Number.isFinite(+name);
|
|
55070
|
+
const isLast = index >= path.length;
|
|
55071
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
55072
|
+
|
|
55073
|
+
if (isLast) {
|
|
55074
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
55075
|
+
target[name] = utils$1.isArray(target[name])
|
|
55076
|
+
? target[name].concat(value)
|
|
55077
|
+
: [target[name], value];
|
|
55078
|
+
} else {
|
|
55079
|
+
target[name] = value;
|
|
55080
|
+
}
|
|
55081
|
+
|
|
55082
|
+
return !isNumericKey;
|
|
55083
|
+
}
|
|
55084
|
+
|
|
55085
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
55086
|
+
target[name] = [];
|
|
55087
|
+
}
|
|
55088
|
+
|
|
55089
|
+
const result = buildPath(path, value, target[name], index);
|
|
55090
|
+
|
|
55091
|
+
if (result && utils$1.isArray(target[name])) {
|
|
55092
|
+
target[name] = arrayToObject(target[name]);
|
|
55093
|
+
}
|
|
55094
|
+
|
|
55095
|
+
return !isNumericKey;
|
|
55096
|
+
}
|
|
55097
|
+
|
|
55098
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
55099
|
+
const obj = {};
|
|
55100
|
+
|
|
55101
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
55102
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
55103
|
+
});
|
|
55104
|
+
|
|
55105
|
+
return obj;
|
|
55106
|
+
}
|
|
55107
|
+
|
|
55108
|
+
return null;
|
|
55109
|
+
}
|
|
55110
|
+
|
|
55111
|
+
const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
55112
|
+
|
|
55113
|
+
/**
|
|
55114
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
55115
|
+
* of the input
|
|
55116
|
+
*
|
|
55117
|
+
* @param {any} rawValue - The value to be stringified.
|
|
55118
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
55119
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
55120
|
+
*
|
|
55121
|
+
* @returns {string} A stringified version of the rawValue.
|
|
55122
|
+
*/
|
|
55123
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
55124
|
+
if (utils$1.isString(rawValue)) {
|
|
55125
|
+
try {
|
|
55126
|
+
(parser || JSON.parse)(rawValue);
|
|
55127
|
+
return utils$1.trim(rawValue);
|
|
55128
|
+
} catch (e) {
|
|
55129
|
+
if (e.name !== 'SyntaxError') {
|
|
55130
|
+
throw e;
|
|
55131
|
+
}
|
|
55132
|
+
}
|
|
55133
|
+
}
|
|
55134
|
+
|
|
55135
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
55136
|
+
}
|
|
55137
|
+
|
|
55138
|
+
const defaults = {
|
|
55139
|
+
transitional: transitionalDefaults,
|
|
55140
|
+
|
|
55141
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
55142
|
+
|
|
55143
|
+
transformRequest: [
|
|
55144
|
+
function transformRequest(data, headers) {
|
|
55145
|
+
const contentType = headers.getContentType() || '';
|
|
55146
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
55147
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
55148
|
+
|
|
55149
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
55150
|
+
data = new FormData(data);
|
|
55151
|
+
}
|
|
55152
|
+
|
|
55153
|
+
const isFormData = utils$1.isFormData(data);
|
|
55154
|
+
|
|
55155
|
+
if (isFormData) {
|
|
55156
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
55157
|
+
}
|
|
55158
|
+
|
|
55159
|
+
if (
|
|
55160
|
+
utils$1.isArrayBuffer(data) ||
|
|
55161
|
+
utils$1.isBuffer(data) ||
|
|
55162
|
+
utils$1.isStream(data) ||
|
|
55163
|
+
utils$1.isFile(data) ||
|
|
55164
|
+
utils$1.isBlob(data) ||
|
|
55165
|
+
utils$1.isReadableStream(data)
|
|
55166
|
+
) {
|
|
55167
|
+
return data;
|
|
55168
|
+
}
|
|
55169
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
55170
|
+
return data.buffer;
|
|
55171
|
+
}
|
|
55172
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
55173
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
55174
|
+
return data.toString();
|
|
55175
|
+
}
|
|
55176
|
+
|
|
55177
|
+
let isFileList;
|
|
55178
|
+
|
|
55179
|
+
if (isObjectPayload) {
|
|
55180
|
+
const formSerializer = own(this, 'formSerializer');
|
|
55181
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
55182
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
55183
|
+
}
|
|
55184
|
+
|
|
55185
|
+
if (
|
|
55186
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
55187
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
55188
|
+
) {
|
|
55189
|
+
const env = own(this, 'env');
|
|
55190
|
+
const _FormData = env && env.FormData;
|
|
55191
|
+
|
|
55192
|
+
return toFormData(
|
|
55193
|
+
isFileList ? { 'files[]': data } : data,
|
|
55194
|
+
_FormData && new _FormData(),
|
|
55195
|
+
formSerializer
|
|
55196
|
+
);
|
|
55197
|
+
}
|
|
55198
|
+
}
|
|
55199
|
+
|
|
55200
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
55201
|
+
headers.setContentType('application/json', false);
|
|
55202
|
+
return stringifySafely(data);
|
|
55203
|
+
}
|
|
55204
|
+
|
|
55205
|
+
return data;
|
|
55206
|
+
},
|
|
55207
|
+
],
|
|
55208
|
+
|
|
55209
|
+
transformResponse: [
|
|
55210
|
+
function transformResponse(data) {
|
|
55211
|
+
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
55212
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
55213
|
+
const responseType = own(this, 'responseType');
|
|
55214
|
+
const JSONRequested = responseType === 'json';
|
|
55215
|
+
|
|
55216
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
55217
|
+
return data;
|
|
55218
|
+
}
|
|
55219
|
+
|
|
55220
|
+
if (
|
|
55221
|
+
data &&
|
|
55222
|
+
utils$1.isString(data) &&
|
|
55223
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
55224
|
+
) {
|
|
55225
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
55226
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
55227
|
+
|
|
55228
|
+
try {
|
|
55229
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
55230
|
+
} catch (e) {
|
|
55231
|
+
if (strictJSONParsing) {
|
|
55232
|
+
if (e.name === 'SyntaxError') {
|
|
55233
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
55234
|
+
}
|
|
55235
|
+
throw e;
|
|
55236
|
+
}
|
|
55237
|
+
}
|
|
55238
|
+
}
|
|
55239
|
+
|
|
55240
|
+
return data;
|
|
55241
|
+
},
|
|
55242
|
+
],
|
|
55243
|
+
|
|
55244
|
+
/**
|
|
55245
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
55246
|
+
* timeout is not created.
|
|
55247
|
+
*/
|
|
55248
|
+
timeout: 0,
|
|
55249
|
+
|
|
55250
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
55251
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
55252
|
+
|
|
55253
|
+
maxContentLength: -1,
|
|
55254
|
+
maxBodyLength: -1,
|
|
55255
|
+
|
|
55256
|
+
env: {
|
|
55257
|
+
FormData: platform.classes.FormData,
|
|
55258
|
+
Blob: platform.classes.Blob,
|
|
55259
|
+
},
|
|
55260
|
+
|
|
55261
|
+
validateStatus: function validateStatus(status) {
|
|
55262
|
+
return status >= 200 && status < 300;
|
|
55263
|
+
},
|
|
55264
|
+
|
|
55265
|
+
headers: {
|
|
55266
|
+
common: {
|
|
55267
|
+
Accept: 'application/json, text/plain, */*',
|
|
55268
|
+
'Content-Type': undefined,
|
|
55269
|
+
},
|
|
55270
|
+
},
|
|
55271
|
+
};
|
|
55272
|
+
|
|
55273
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
55274
|
+
defaults.headers[method] = {};
|
|
55275
|
+
});
|
|
55276
|
+
|
|
55277
|
+
// RawAxiosHeaders whose duplicates are ignored by node
|
|
55278
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
55279
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
55280
|
+
'age',
|
|
55281
|
+
'authorization',
|
|
55282
|
+
'content-length',
|
|
55283
|
+
'content-type',
|
|
55284
|
+
'etag',
|
|
55285
|
+
'expires',
|
|
55286
|
+
'from',
|
|
55287
|
+
'host',
|
|
55288
|
+
'if-modified-since',
|
|
55289
|
+
'if-unmodified-since',
|
|
55290
|
+
'last-modified',
|
|
55291
|
+
'location',
|
|
55292
|
+
'max-forwards',
|
|
55293
|
+
'proxy-authorization',
|
|
55294
|
+
'referer',
|
|
55295
|
+
'retry-after',
|
|
55296
|
+
'user-agent',
|
|
55297
|
+
]);
|
|
55298
|
+
|
|
55299
|
+
/**
|
|
55300
|
+
* Parse headers into an object
|
|
55301
|
+
*
|
|
55302
|
+
* ```
|
|
55303
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
55304
|
+
* Content-Type: application/json
|
|
55305
|
+
* Connection: keep-alive
|
|
55306
|
+
* Transfer-Encoding: chunked
|
|
55307
|
+
* ```
|
|
55308
|
+
*
|
|
55309
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
55310
|
+
*
|
|
55311
|
+
* @returns {Object} Headers parsed into an object
|
|
55312
|
+
*/
|
|
55313
|
+
var parseHeaders = (rawHeaders) => {
|
|
55314
|
+
const parsed = {};
|
|
55315
|
+
let key;
|
|
55316
|
+
let val;
|
|
55317
|
+
let i;
|
|
55318
|
+
|
|
55319
|
+
rawHeaders &&
|
|
55320
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
55321
|
+
i = line.indexOf(':');
|
|
55322
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
55323
|
+
val = line.substring(i + 1).trim();
|
|
55324
|
+
|
|
55325
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
55326
|
+
return;
|
|
55327
|
+
}
|
|
55328
|
+
|
|
55329
|
+
if (key === 'set-cookie') {
|
|
55330
|
+
if (parsed[key]) {
|
|
55331
|
+
parsed[key].push(val);
|
|
55332
|
+
} else {
|
|
55333
|
+
parsed[key] = [val];
|
|
55334
|
+
}
|
|
55335
|
+
} else {
|
|
55336
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
55337
|
+
}
|
|
55338
|
+
});
|
|
55339
|
+
|
|
55340
|
+
return parsed;
|
|
55341
|
+
};
|
|
55342
|
+
|
|
55343
|
+
const $internals = Symbol('internals');
|
|
55344
|
+
|
|
55345
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
55346
|
+
|
|
55347
|
+
function trimSPorHTAB(str) {
|
|
55348
|
+
let start = 0;
|
|
55349
|
+
let end = str.length;
|
|
55350
|
+
|
|
55351
|
+
while (start < end) {
|
|
55352
|
+
const code = str.charCodeAt(start);
|
|
55353
|
+
|
|
55354
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
55355
|
+
break;
|
|
55356
|
+
}
|
|
55357
|
+
|
|
55358
|
+
start += 1;
|
|
55359
|
+
}
|
|
55360
|
+
|
|
55361
|
+
while (end > start) {
|
|
55362
|
+
const code = str.charCodeAt(end - 1);
|
|
55363
|
+
|
|
55364
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
55365
|
+
break;
|
|
55366
|
+
}
|
|
55367
|
+
|
|
55368
|
+
end -= 1;
|
|
55369
|
+
}
|
|
55370
|
+
|
|
55371
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
55372
|
+
}
|
|
55373
|
+
|
|
55374
|
+
function normalizeHeader(header) {
|
|
55375
|
+
return header && String(header).trim().toLowerCase();
|
|
55376
|
+
}
|
|
55377
|
+
|
|
55378
|
+
function sanitizeHeaderValue(str) {
|
|
55379
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
55380
|
+
}
|
|
55381
|
+
|
|
55382
|
+
function normalizeValue(value) {
|
|
55383
|
+
if (value === false || value == null) {
|
|
55384
|
+
return value;
|
|
55385
|
+
}
|
|
55386
|
+
|
|
55387
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
55388
|
+
}
|
|
55389
|
+
|
|
55390
|
+
function parseTokens(str) {
|
|
55391
|
+
const tokens = Object.create(null);
|
|
55392
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
55393
|
+
let match;
|
|
55394
|
+
|
|
55395
|
+
while ((match = tokensRE.exec(str))) {
|
|
55396
|
+
tokens[match[1]] = match[2];
|
|
55397
|
+
}
|
|
55398
|
+
|
|
55399
|
+
return tokens;
|
|
55400
|
+
}
|
|
55401
|
+
|
|
55402
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
55403
|
+
|
|
55404
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
55405
|
+
if (utils$1.isFunction(filter)) {
|
|
55406
|
+
return filter.call(this, value, header);
|
|
55407
|
+
}
|
|
55408
|
+
|
|
55409
|
+
if (isHeaderNameFilter) {
|
|
55410
|
+
value = header;
|
|
55411
|
+
}
|
|
55412
|
+
|
|
55413
|
+
if (!utils$1.isString(value)) return;
|
|
55414
|
+
|
|
55415
|
+
if (utils$1.isString(filter)) {
|
|
55416
|
+
return value.indexOf(filter) !== -1;
|
|
55417
|
+
}
|
|
55418
|
+
|
|
55419
|
+
if (utils$1.isRegExp(filter)) {
|
|
55420
|
+
return filter.test(value);
|
|
55421
|
+
}
|
|
55422
|
+
}
|
|
55423
|
+
|
|
55424
|
+
function formatHeader(header) {
|
|
55425
|
+
return header
|
|
55426
|
+
.trim()
|
|
55427
|
+
.toLowerCase()
|
|
55428
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
55429
|
+
return char.toUpperCase() + str;
|
|
55430
|
+
});
|
|
55431
|
+
}
|
|
55432
|
+
|
|
55433
|
+
function buildAccessors(obj, header) {
|
|
55434
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
55435
|
+
|
|
55436
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
55437
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
55438
|
+
value: function (arg1, arg2, arg3) {
|
|
55439
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
55440
|
+
},
|
|
55441
|
+
configurable: true,
|
|
55442
|
+
});
|
|
55443
|
+
});
|
|
55444
|
+
}
|
|
55445
|
+
|
|
55446
|
+
class AxiosHeaders {
|
|
55447
|
+
constructor(headers) {
|
|
55448
|
+
headers && this.set(headers);
|
|
55449
|
+
}
|
|
56073
55450
|
|
|
56074
|
-
|
|
55451
|
+
set(header, valueOrRewrite, rewrite) {
|
|
55452
|
+
const self = this;
|
|
56075
55453
|
|
|
56076
|
-
|
|
56077
|
-
|
|
56078
|
-
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
55454
|
+
function setHeader(_value, _header, _rewrite) {
|
|
55455
|
+
const lHeader = normalizeHeader(_header);
|
|
56079
55456
|
|
|
56080
|
-
|
|
56081
|
-
|
|
56082
|
-
target[name] = utils$1.isArray(target[name])
|
|
56083
|
-
? target[name].concat(value)
|
|
56084
|
-
: [target[name], value];
|
|
56085
|
-
} else {
|
|
56086
|
-
target[name] = value;
|
|
55457
|
+
if (!lHeader) {
|
|
55458
|
+
throw new Error('header name must be a non-empty string');
|
|
56087
55459
|
}
|
|
56088
55460
|
|
|
56089
|
-
|
|
56090
|
-
}
|
|
55461
|
+
const key = utils$1.findKey(self, lHeader);
|
|
56091
55462
|
|
|
56092
|
-
|
|
56093
|
-
|
|
55463
|
+
if (
|
|
55464
|
+
!key ||
|
|
55465
|
+
self[key] === undefined ||
|
|
55466
|
+
_rewrite === true ||
|
|
55467
|
+
(_rewrite === undefined && self[key] !== false)
|
|
55468
|
+
) {
|
|
55469
|
+
self[key || _header] = normalizeValue(_value);
|
|
55470
|
+
}
|
|
56094
55471
|
}
|
|
56095
55472
|
|
|
56096
|
-
const
|
|
55473
|
+
const setHeaders = (headers, _rewrite) =>
|
|
55474
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
56097
55475
|
|
|
56098
|
-
if (
|
|
56099
|
-
|
|
55476
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
55477
|
+
setHeaders(header, valueOrRewrite);
|
|
55478
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
55479
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
55480
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
55481
|
+
let obj = {},
|
|
55482
|
+
dest,
|
|
55483
|
+
key;
|
|
55484
|
+
for (const entry of header) {
|
|
55485
|
+
if (!utils$1.isArray(entry)) {
|
|
55486
|
+
throw TypeError('Object iterator must return a key-value pair');
|
|
55487
|
+
}
|
|
55488
|
+
|
|
55489
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
55490
|
+
? utils$1.isArray(dest)
|
|
55491
|
+
? [...dest, entry[1]]
|
|
55492
|
+
: [dest, entry[1]]
|
|
55493
|
+
: entry[1];
|
|
55494
|
+
}
|
|
55495
|
+
|
|
55496
|
+
setHeaders(obj, valueOrRewrite);
|
|
55497
|
+
} else {
|
|
55498
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
56100
55499
|
}
|
|
56101
55500
|
|
|
56102
|
-
return
|
|
55501
|
+
return this;
|
|
56103
55502
|
}
|
|
56104
55503
|
|
|
56105
|
-
|
|
56106
|
-
|
|
55504
|
+
get(header, parser) {
|
|
55505
|
+
header = normalizeHeader(header);
|
|
56107
55506
|
|
|
56108
|
-
|
|
56109
|
-
|
|
56110
|
-
});
|
|
55507
|
+
if (header) {
|
|
55508
|
+
const key = utils$1.findKey(this, header);
|
|
56111
55509
|
|
|
56112
|
-
|
|
56113
|
-
|
|
55510
|
+
if (key) {
|
|
55511
|
+
const value = this[key];
|
|
56114
55512
|
|
|
56115
|
-
|
|
56116
|
-
|
|
55513
|
+
if (!parser) {
|
|
55514
|
+
return value;
|
|
55515
|
+
}
|
|
56117
55516
|
|
|
56118
|
-
|
|
55517
|
+
if (parser === true) {
|
|
55518
|
+
return parseTokens(value);
|
|
55519
|
+
}
|
|
56119
55520
|
|
|
56120
|
-
|
|
56121
|
-
|
|
56122
|
-
|
|
56123
|
-
|
|
56124
|
-
|
|
56125
|
-
|
|
56126
|
-
|
|
56127
|
-
|
|
56128
|
-
|
|
56129
|
-
*/
|
|
56130
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
56131
|
-
if (utils$1.isString(rawValue)) {
|
|
56132
|
-
try {
|
|
56133
|
-
(parser || JSON.parse)(rawValue);
|
|
56134
|
-
return utils$1.trim(rawValue);
|
|
56135
|
-
} catch (e) {
|
|
56136
|
-
if (e.name !== 'SyntaxError') {
|
|
56137
|
-
throw e;
|
|
55521
|
+
if (utils$1.isFunction(parser)) {
|
|
55522
|
+
return parser.call(this, value, key);
|
|
55523
|
+
}
|
|
55524
|
+
|
|
55525
|
+
if (utils$1.isRegExp(parser)) {
|
|
55526
|
+
return parser.exec(value);
|
|
55527
|
+
}
|
|
55528
|
+
|
|
55529
|
+
throw new TypeError('parser must be boolean|regexp|function');
|
|
56138
55530
|
}
|
|
56139
55531
|
}
|
|
56140
55532
|
}
|
|
56141
55533
|
|
|
56142
|
-
|
|
56143
|
-
|
|
55534
|
+
has(header, matcher) {
|
|
55535
|
+
header = normalizeHeader(header);
|
|
56144
55536
|
|
|
56145
|
-
|
|
56146
|
-
|
|
55537
|
+
if (header) {
|
|
55538
|
+
const key = utils$1.findKey(this, header);
|
|
56147
55539
|
|
|
56148
|
-
|
|
55540
|
+
return !!(
|
|
55541
|
+
key &&
|
|
55542
|
+
this[key] !== undefined &&
|
|
55543
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
55544
|
+
);
|
|
55545
|
+
}
|
|
56149
55546
|
|
|
56150
|
-
|
|
56151
|
-
|
|
56152
|
-
const contentType = headers.getContentType() || '';
|
|
56153
|
-
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
56154
|
-
const isObjectPayload = utils$1.isObject(data);
|
|
55547
|
+
return false;
|
|
55548
|
+
}
|
|
56155
55549
|
|
|
56156
|
-
|
|
56157
|
-
|
|
56158
|
-
|
|
55550
|
+
delete(header, matcher) {
|
|
55551
|
+
const self = this;
|
|
55552
|
+
let deleted = false;
|
|
56159
55553
|
|
|
56160
|
-
|
|
55554
|
+
function deleteHeader(_header) {
|
|
55555
|
+
_header = normalizeHeader(_header);
|
|
56161
55556
|
|
|
56162
|
-
if (
|
|
56163
|
-
|
|
56164
|
-
}
|
|
55557
|
+
if (_header) {
|
|
55558
|
+
const key = utils$1.findKey(self, _header);
|
|
56165
55559
|
|
|
56166
|
-
|
|
56167
|
-
|
|
56168
|
-
|
|
56169
|
-
|
|
56170
|
-
|
|
56171
|
-
utils$1.isBlob(data) ||
|
|
56172
|
-
utils$1.isReadableStream(data)
|
|
56173
|
-
) {
|
|
56174
|
-
return data;
|
|
56175
|
-
}
|
|
56176
|
-
if (utils$1.isArrayBufferView(data)) {
|
|
56177
|
-
return data.buffer;
|
|
56178
|
-
}
|
|
56179
|
-
if (utils$1.isURLSearchParams(data)) {
|
|
56180
|
-
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
56181
|
-
return data.toString();
|
|
55560
|
+
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
55561
|
+
delete self[key];
|
|
55562
|
+
|
|
55563
|
+
deleted = true;
|
|
55564
|
+
}
|
|
56182
55565
|
}
|
|
55566
|
+
}
|
|
56183
55567
|
|
|
56184
|
-
|
|
55568
|
+
if (utils$1.isArray(header)) {
|
|
55569
|
+
header.forEach(deleteHeader);
|
|
55570
|
+
} else {
|
|
55571
|
+
deleteHeader(header);
|
|
55572
|
+
}
|
|
56185
55573
|
|
|
56186
|
-
|
|
56187
|
-
|
|
56188
|
-
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
56189
|
-
return toURLEncodedForm(data, formSerializer).toString();
|
|
56190
|
-
}
|
|
55574
|
+
return deleted;
|
|
55575
|
+
}
|
|
56191
55576
|
|
|
56192
|
-
|
|
56193
|
-
|
|
56194
|
-
|
|
56195
|
-
|
|
56196
|
-
const env = own(this, 'env');
|
|
56197
|
-
const _FormData = env && env.FormData;
|
|
55577
|
+
clear(matcher) {
|
|
55578
|
+
const keys = Object.keys(this);
|
|
55579
|
+
let i = keys.length;
|
|
55580
|
+
let deleted = false;
|
|
56198
55581
|
|
|
56199
|
-
|
|
56200
|
-
|
|
56201
|
-
|
|
56202
|
-
|
|
56203
|
-
|
|
56204
|
-
}
|
|
55582
|
+
while (i--) {
|
|
55583
|
+
const key = keys[i];
|
|
55584
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
55585
|
+
delete this[key];
|
|
55586
|
+
deleted = true;
|
|
56205
55587
|
}
|
|
55588
|
+
}
|
|
56206
55589
|
|
|
56207
|
-
|
|
56208
|
-
|
|
56209
|
-
return stringifySafely(data);
|
|
56210
|
-
}
|
|
55590
|
+
return deleted;
|
|
55591
|
+
}
|
|
56211
55592
|
|
|
56212
|
-
|
|
56213
|
-
|
|
56214
|
-
|
|
55593
|
+
normalize(format) {
|
|
55594
|
+
const self = this;
|
|
55595
|
+
const headers = {};
|
|
56215
55596
|
|
|
56216
|
-
|
|
56217
|
-
|
|
56218
|
-
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
56219
|
-
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
56220
|
-
const responseType = own(this, 'responseType');
|
|
56221
|
-
const JSONRequested = responseType === 'json';
|
|
55597
|
+
utils$1.forEach(this, (value, header) => {
|
|
55598
|
+
const key = utils$1.findKey(headers, header);
|
|
56222
55599
|
|
|
56223
|
-
if (
|
|
56224
|
-
|
|
55600
|
+
if (key) {
|
|
55601
|
+
self[key] = normalizeValue(value);
|
|
55602
|
+
delete self[header];
|
|
55603
|
+
return;
|
|
56225
55604
|
}
|
|
56226
55605
|
|
|
56227
|
-
|
|
56228
|
-
data &&
|
|
56229
|
-
utils$1.isString(data) &&
|
|
56230
|
-
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
56231
|
-
) {
|
|
56232
|
-
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
56233
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
55606
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
56234
55607
|
|
|
56235
|
-
|
|
56236
|
-
|
|
56237
|
-
} catch (e) {
|
|
56238
|
-
if (strictJSONParsing) {
|
|
56239
|
-
if (e.name === 'SyntaxError') {
|
|
56240
|
-
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
56241
|
-
}
|
|
56242
|
-
throw e;
|
|
56243
|
-
}
|
|
56244
|
-
}
|
|
55608
|
+
if (normalized !== header) {
|
|
55609
|
+
delete self[header];
|
|
56245
55610
|
}
|
|
56246
55611
|
|
|
56247
|
-
|
|
56248
|
-
},
|
|
56249
|
-
],
|
|
55612
|
+
self[normalized] = normalizeValue(value);
|
|
56250
55613
|
|
|
56251
|
-
|
|
56252
|
-
|
|
56253
|
-
* timeout is not created.
|
|
56254
|
-
*/
|
|
56255
|
-
timeout: 0,
|
|
55614
|
+
headers[normalized] = true;
|
|
55615
|
+
});
|
|
56256
55616
|
|
|
56257
|
-
|
|
56258
|
-
|
|
55617
|
+
return this;
|
|
55618
|
+
}
|
|
56259
55619
|
|
|
56260
|
-
|
|
56261
|
-
|
|
55620
|
+
concat(...targets) {
|
|
55621
|
+
return this.constructor.concat(this, ...targets);
|
|
55622
|
+
}
|
|
56262
55623
|
|
|
56263
|
-
|
|
56264
|
-
|
|
56265
|
-
Blob: platform.classes.Blob,
|
|
56266
|
-
},
|
|
55624
|
+
toJSON(asStrings) {
|
|
55625
|
+
const obj = Object.create(null);
|
|
56267
55626
|
|
|
56268
|
-
|
|
56269
|
-
|
|
56270
|
-
|
|
55627
|
+
utils$1.forEach(this, (value, header) => {
|
|
55628
|
+
value != null &&
|
|
55629
|
+
value !== false &&
|
|
55630
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
55631
|
+
});
|
|
56271
55632
|
|
|
56272
|
-
|
|
56273
|
-
|
|
56274
|
-
Accept: 'application/json, text/plain, */*',
|
|
56275
|
-
'Content-Type': undefined,
|
|
56276
|
-
},
|
|
56277
|
-
},
|
|
56278
|
-
};
|
|
55633
|
+
return obj;
|
|
55634
|
+
}
|
|
56279
55635
|
|
|
56280
|
-
|
|
56281
|
-
|
|
55636
|
+
[Symbol.iterator]() {
|
|
55637
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
55638
|
+
}
|
|
55639
|
+
|
|
55640
|
+
toString() {
|
|
55641
|
+
return Object.entries(this.toJSON())
|
|
55642
|
+
.map(([header, value]) => header + ': ' + value)
|
|
55643
|
+
.join('\n');
|
|
55644
|
+
}
|
|
55645
|
+
|
|
55646
|
+
getSetCookie() {
|
|
55647
|
+
return this.get('set-cookie') || [];
|
|
55648
|
+
}
|
|
55649
|
+
|
|
55650
|
+
get [Symbol.toStringTag]() {
|
|
55651
|
+
return 'AxiosHeaders';
|
|
55652
|
+
}
|
|
55653
|
+
|
|
55654
|
+
static from(thing) {
|
|
55655
|
+
return thing instanceof this ? thing : new this(thing);
|
|
55656
|
+
}
|
|
55657
|
+
|
|
55658
|
+
static concat(first, ...targets) {
|
|
55659
|
+
const computed = new this(first);
|
|
55660
|
+
|
|
55661
|
+
targets.forEach((target) => computed.set(target));
|
|
55662
|
+
|
|
55663
|
+
return computed;
|
|
55664
|
+
}
|
|
55665
|
+
|
|
55666
|
+
static accessor(header) {
|
|
55667
|
+
const internals =
|
|
55668
|
+
(this[$internals] =
|
|
55669
|
+
this[$internals] =
|
|
55670
|
+
{
|
|
55671
|
+
accessors: {},
|
|
55672
|
+
});
|
|
55673
|
+
|
|
55674
|
+
const accessors = internals.accessors;
|
|
55675
|
+
const prototype = this.prototype;
|
|
55676
|
+
|
|
55677
|
+
function defineAccessor(_header) {
|
|
55678
|
+
const lHeader = normalizeHeader(_header);
|
|
55679
|
+
|
|
55680
|
+
if (!accessors[lHeader]) {
|
|
55681
|
+
buildAccessors(prototype, _header);
|
|
55682
|
+
accessors[lHeader] = true;
|
|
55683
|
+
}
|
|
55684
|
+
}
|
|
55685
|
+
|
|
55686
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
55687
|
+
|
|
55688
|
+
return this;
|
|
55689
|
+
}
|
|
55690
|
+
}
|
|
55691
|
+
|
|
55692
|
+
AxiosHeaders.accessor([
|
|
55693
|
+
'Content-Type',
|
|
55694
|
+
'Content-Length',
|
|
55695
|
+
'Accept',
|
|
55696
|
+
'Accept-Encoding',
|
|
55697
|
+
'User-Agent',
|
|
55698
|
+
'Authorization',
|
|
55699
|
+
]);
|
|
55700
|
+
|
|
55701
|
+
// reserved names hotfix
|
|
55702
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
55703
|
+
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
55704
|
+
return {
|
|
55705
|
+
get: () => value,
|
|
55706
|
+
set(headerValue) {
|
|
55707
|
+
this[mapped] = headerValue;
|
|
55708
|
+
},
|
|
55709
|
+
};
|
|
56282
55710
|
});
|
|
56283
55711
|
|
|
55712
|
+
utils$1.freezeMethods(AxiosHeaders);
|
|
55713
|
+
|
|
56284
55714
|
/**
|
|
56285
55715
|
* Transform the data for a request or a response
|
|
56286
55716
|
*
|
|
@@ -56339,18 +55769,22 @@ function settle(resolve, reject, response) {
|
|
|
56339
55769
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
56340
55770
|
resolve(response);
|
|
56341
55771
|
} else {
|
|
56342
|
-
reject(
|
|
56343
|
-
|
|
56344
|
-
|
|
56345
|
-
|
|
56346
|
-
|
|
56347
|
-
|
|
56348
|
-
|
|
55772
|
+
reject(
|
|
55773
|
+
new AxiosError(
|
|
55774
|
+
'Request failed with status code ' + response.status,
|
|
55775
|
+
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][
|
|
55776
|
+
Math.floor(response.status / 100) - 4
|
|
55777
|
+
],
|
|
55778
|
+
response.config,
|
|
55779
|
+
response.request,
|
|
55780
|
+
response
|
|
55781
|
+
)
|
|
55782
|
+
);
|
|
56349
55783
|
}
|
|
56350
55784
|
}
|
|
56351
55785
|
|
|
56352
55786
|
function parseProtocol(url) {
|
|
56353
|
-
const match = /^([-+\w]{1,25})
|
|
55787
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
56354
55788
|
return (match && match[1]) || '';
|
|
56355
55789
|
}
|
|
56356
55790
|
|
|
@@ -56454,9 +55888,6 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
56454
55888
|
const _speedometer = speedometer(50, 250);
|
|
56455
55889
|
|
|
56456
55890
|
return throttle((e) => {
|
|
56457
|
-
if (!e || typeof e.loaded !== 'number') {
|
|
56458
|
-
return;
|
|
56459
|
-
}
|
|
56460
55891
|
const rawLoaded = e.loaded;
|
|
56461
55892
|
const total = e.lengthComputable ? e.total : undefined;
|
|
56462
55893
|
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
@@ -56544,20 +55975,8 @@ var cookies = platform.hasStandardBrowserEnv
|
|
|
56544
55975
|
|
|
56545
55976
|
read(name) {
|
|
56546
55977
|
if (typeof document === 'undefined') return null;
|
|
56547
|
-
|
|
56548
|
-
|
|
56549
|
-
// metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
|
|
56550
|
-
// match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
|
|
56551
|
-
// "; ", so ignore optional whitespace before each cookie name.
|
|
56552
|
-
const cookies = document.cookie.split(';');
|
|
56553
|
-
for (let i = 0; i < cookies.length; i++) {
|
|
56554
|
-
const cookie = cookies[i].replace(/^\s+/, '');
|
|
56555
|
-
const eq = cookie.indexOf('=');
|
|
56556
|
-
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
56557
|
-
return decodeURIComponent(cookie.slice(eq + 1));
|
|
56558
|
-
}
|
|
56559
|
-
}
|
|
56560
|
-
return null;
|
|
55978
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
55979
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
56561
55980
|
},
|
|
56562
55981
|
|
|
56563
55982
|
remove(name) {
|
|
@@ -56639,14 +56058,11 @@ function mergeConfig(config1, config2) {
|
|
|
56639
56058
|
config2 = config2 || {};
|
|
56640
56059
|
|
|
56641
56060
|
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
56642
|
-
// or `config.baseURL` cannot inherit polluted values from Object.prototype
|
|
56643
|
-
// `hasOwnProperty` is restored as a non-enumerable
|
|
56644
|
-
// ergonomics for user code that relies on it.
|
|
56061
|
+
// or `config.baseURL` cannot inherit polluted values from Object.prototype
|
|
56062
|
+
// (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
|
|
56063
|
+
// own slot to preserve ergonomics for user code that relies on it.
|
|
56645
56064
|
const config = Object.create(null);
|
|
56646
56065
|
Object.defineProperty(config, 'hasOwnProperty', {
|
|
56647
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
56648
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
56649
|
-
__proto__: null,
|
|
56650
56066
|
value: Object.prototype.hasOwnProperty,
|
|
56651
56067
|
enumerable: false,
|
|
56652
56068
|
writable: true,
|
|
@@ -56743,39 +56159,11 @@ function mergeConfig(config1, config2) {
|
|
|
56743
56159
|
return config;
|
|
56744
56160
|
}
|
|
56745
56161
|
|
|
56746
|
-
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
56747
|
-
|
|
56748
|
-
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
56749
|
-
if (policy !== 'content-only') {
|
|
56750
|
-
headers.set(formHeaders);
|
|
56751
|
-
return;
|
|
56752
|
-
}
|
|
56753
|
-
|
|
56754
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
56755
|
-
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
56756
|
-
headers.set(key, val);
|
|
56757
|
-
}
|
|
56758
|
-
});
|
|
56759
|
-
}
|
|
56760
|
-
|
|
56761
|
-
/**
|
|
56762
|
-
* Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
|
|
56763
|
-
* This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
|
|
56764
|
-
*
|
|
56765
|
-
* @param {string} str The string to encode
|
|
56766
|
-
*
|
|
56767
|
-
* @returns {string} UTF-8 bytes as a Latin-1 string
|
|
56768
|
-
*/
|
|
56769
|
-
const encodeUTF8 = (str) =>
|
|
56770
|
-
encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
|
|
56771
|
-
String.fromCharCode(parseInt(hex, 16))
|
|
56772
|
-
);
|
|
56773
|
-
|
|
56774
56162
|
var resolveConfig = (config) => {
|
|
56775
56163
|
const newConfig = mergeConfig({}, config);
|
|
56776
56164
|
|
|
56777
56165
|
// Read only own properties to prevent prototype pollution gadgets
|
|
56778
|
-
// (e.g. Object.prototype.baseURL = 'https://evil.com').
|
|
56166
|
+
// (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
|
|
56779
56167
|
const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
|
|
56780
56168
|
|
|
56781
56169
|
const data = own('data');
|
|
@@ -56801,7 +56189,11 @@ var resolveConfig = (config) => {
|
|
|
56801
56189
|
headers.set(
|
|
56802
56190
|
'Authorization',
|
|
56803
56191
|
'Basic ' +
|
|
56804
|
-
btoa(
|
|
56192
|
+
btoa(
|
|
56193
|
+
(auth.username || '') +
|
|
56194
|
+
':' +
|
|
56195
|
+
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
56196
|
+
)
|
|
56805
56197
|
);
|
|
56806
56198
|
}
|
|
56807
56199
|
|
|
@@ -56810,7 +56202,14 @@ var resolveConfig = (config) => {
|
|
|
56810
56202
|
headers.setContentType(undefined); // browser handles it
|
|
56811
56203
|
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
56812
56204
|
// Node.js FormData (like form-data package)
|
|
56813
|
-
|
|
56205
|
+
const formHeaders = data.getHeaders();
|
|
56206
|
+
// Only set safe headers to avoid overwriting security headers
|
|
56207
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
56208
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
56209
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
56210
|
+
headers.set(key, val);
|
|
56211
|
+
}
|
|
56212
|
+
});
|
|
56814
56213
|
}
|
|
56815
56214
|
}
|
|
56816
56215
|
|
|
@@ -56825,9 +56224,10 @@ var resolveConfig = (config) => {
|
|
|
56825
56224
|
|
|
56826
56225
|
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
56827
56226
|
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
56828
|
-
// the XSRF token cross-origin.
|
|
56227
|
+
// the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
|
|
56829
56228
|
const shouldSendXSRF =
|
|
56830
|
-
withXSRFToken === true ||
|
|
56229
|
+
withXSRFToken === true ||
|
|
56230
|
+
(withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
56831
56231
|
|
|
56832
56232
|
if (shouldSendXSRF) {
|
|
56833
56233
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
@@ -56923,7 +56323,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
56923
56323
|
// will return status as 0 even though it's a successful request
|
|
56924
56324
|
if (
|
|
56925
56325
|
request.status === 0 &&
|
|
56926
|
-
!(request.responseURL && request.responseURL.
|
|
56326
|
+
!(request.responseURL && request.responseURL.indexOf('file:') === 0)
|
|
56927
56327
|
) {
|
|
56928
56328
|
return;
|
|
56929
56329
|
}
|
|
@@ -56940,7 +56340,6 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
56940
56340
|
}
|
|
56941
56341
|
|
|
56942
56342
|
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
56943
|
-
done();
|
|
56944
56343
|
|
|
56945
56344
|
// Clean up request
|
|
56946
56345
|
request = null;
|
|
@@ -56956,7 +56355,6 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
56956
56355
|
// attach the underlying event for consumers who want details
|
|
56957
56356
|
err.event = event || null;
|
|
56958
56357
|
reject(err);
|
|
56959
|
-
done();
|
|
56960
56358
|
request = null;
|
|
56961
56359
|
};
|
|
56962
56360
|
|
|
@@ -56977,7 +56375,6 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
56977
56375
|
request
|
|
56978
56376
|
)
|
|
56979
56377
|
);
|
|
56980
|
-
done();
|
|
56981
56378
|
|
|
56982
56379
|
// Clean up request
|
|
56983
56380
|
request = null;
|
|
@@ -56988,7 +56385,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
56988
56385
|
|
|
56989
56386
|
// Add headers to the request
|
|
56990
56387
|
if ('setRequestHeader' in request) {
|
|
56991
|
-
utils$1.forEach(
|
|
56388
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
56992
56389
|
request.setRequestHeader(key, val);
|
|
56993
56390
|
});
|
|
56994
56391
|
}
|
|
@@ -57027,7 +56424,6 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
57027
56424
|
}
|
|
57028
56425
|
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
57029
56426
|
request.abort();
|
|
57030
|
-
done();
|
|
57031
56427
|
request = null;
|
|
57032
56428
|
};
|
|
57033
56429
|
|
|
@@ -57041,7 +56437,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
57041
56437
|
|
|
57042
56438
|
const protocol = parseProtocol(_config.url);
|
|
57043
56439
|
|
|
57044
|
-
if (protocol &&
|
|
56440
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
57045
56441
|
reject(
|
|
57046
56442
|
new AxiosError(
|
|
57047
56443
|
'Unsupported protocol ' + protocol + ':',
|
|
@@ -57058,55 +56454,54 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
57058
56454
|
};
|
|
57059
56455
|
|
|
57060
56456
|
const composeSignals = (signals, timeout) => {
|
|
57061
|
-
signals = signals ? signals.filter(Boolean) : [];
|
|
57062
|
-
|
|
57063
|
-
if (
|
|
57064
|
-
|
|
57065
|
-
|
|
57066
|
-
|
|
57067
|
-
|
|
57068
|
-
|
|
57069
|
-
|
|
57070
|
-
|
|
57071
|
-
|
|
57072
|
-
|
|
57073
|
-
|
|
57074
|
-
|
|
57075
|
-
|
|
57076
|
-
|
|
57077
|
-
|
|
57078
|
-
|
|
57079
|
-
|
|
57080
|
-
);
|
|
57081
|
-
}
|
|
57082
|
-
};
|
|
56457
|
+
const { length } = (signals = signals ? signals.filter(Boolean) : []);
|
|
56458
|
+
|
|
56459
|
+
if (timeout || length) {
|
|
56460
|
+
let controller = new AbortController();
|
|
56461
|
+
|
|
56462
|
+
let aborted;
|
|
56463
|
+
|
|
56464
|
+
const onabort = function (reason) {
|
|
56465
|
+
if (!aborted) {
|
|
56466
|
+
aborted = true;
|
|
56467
|
+
unsubscribe();
|
|
56468
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
56469
|
+
controller.abort(
|
|
56470
|
+
err instanceof AxiosError
|
|
56471
|
+
? err
|
|
56472
|
+
: new CanceledError(err instanceof Error ? err.message : err)
|
|
56473
|
+
);
|
|
56474
|
+
}
|
|
56475
|
+
};
|
|
57083
56476
|
|
|
57084
|
-
|
|
57085
|
-
|
|
57086
|
-
|
|
57087
|
-
|
|
57088
|
-
|
|
57089
|
-
|
|
57090
|
-
|
|
57091
|
-
|
|
57092
|
-
|
|
57093
|
-
|
|
57094
|
-
|
|
57095
|
-
|
|
57096
|
-
|
|
57097
|
-
|
|
57098
|
-
|
|
57099
|
-
|
|
57100
|
-
|
|
57101
|
-
|
|
56477
|
+
let timer =
|
|
56478
|
+
timeout &&
|
|
56479
|
+
setTimeout(() => {
|
|
56480
|
+
timer = null;
|
|
56481
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
56482
|
+
}, timeout);
|
|
56483
|
+
|
|
56484
|
+
const unsubscribe = () => {
|
|
56485
|
+
if (signals) {
|
|
56486
|
+
timer && clearTimeout(timer);
|
|
56487
|
+
timer = null;
|
|
56488
|
+
signals.forEach((signal) => {
|
|
56489
|
+
signal.unsubscribe
|
|
56490
|
+
? signal.unsubscribe(onabort)
|
|
56491
|
+
: signal.removeEventListener('abort', onabort);
|
|
56492
|
+
});
|
|
56493
|
+
signals = null;
|
|
56494
|
+
}
|
|
56495
|
+
};
|
|
57102
56496
|
|
|
57103
|
-
|
|
56497
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
57104
56498
|
|
|
57105
|
-
|
|
56499
|
+
const { signal } = controller;
|
|
57106
56500
|
|
|
57107
|
-
|
|
56501
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
57108
56502
|
|
|
57109
|
-
|
|
56503
|
+
return signal;
|
|
56504
|
+
}
|
|
57110
56505
|
};
|
|
57111
56506
|
|
|
57112
56507
|
const streamChunk = function* (chunk, chunkSize) {
|
|
@@ -57199,113 +56594,17 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
57199
56594
|
);
|
|
57200
56595
|
};
|
|
57201
56596
|
|
|
57202
|
-
/**
|
|
57203
|
-
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
57204
|
-
* - For base64: compute exact decoded size using length and padding;
|
|
57205
|
-
* handle %XX at the character-count level (no string allocation).
|
|
57206
|
-
* - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
|
|
57207
|
-
*
|
|
57208
|
-
* @param {string} url
|
|
57209
|
-
* @returns {number}
|
|
57210
|
-
*/
|
|
57211
|
-
function estimateDataURLDecodedBytes(url) {
|
|
57212
|
-
if (!url || typeof url !== 'string') return 0;
|
|
57213
|
-
if (!url.startsWith('data:')) return 0;
|
|
57214
|
-
|
|
57215
|
-
const comma = url.indexOf(',');
|
|
57216
|
-
if (comma < 0) return 0;
|
|
57217
|
-
|
|
57218
|
-
const meta = url.slice(5, comma);
|
|
57219
|
-
const body = url.slice(comma + 1);
|
|
57220
|
-
const isBase64 = /;base64/i.test(meta);
|
|
57221
|
-
|
|
57222
|
-
if (isBase64) {
|
|
57223
|
-
let effectiveLen = body.length;
|
|
57224
|
-
const len = body.length; // cache length
|
|
57225
|
-
|
|
57226
|
-
for (let i = 0; i < len; i++) {
|
|
57227
|
-
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
57228
|
-
const a = body.charCodeAt(i + 1);
|
|
57229
|
-
const b = body.charCodeAt(i + 2);
|
|
57230
|
-
const isHex =
|
|
57231
|
-
((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
|
|
57232
|
-
((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
|
|
57233
|
-
|
|
57234
|
-
if (isHex) {
|
|
57235
|
-
effectiveLen -= 2;
|
|
57236
|
-
i += 2;
|
|
57237
|
-
}
|
|
57238
|
-
}
|
|
57239
|
-
}
|
|
57240
|
-
|
|
57241
|
-
let pad = 0;
|
|
57242
|
-
let idx = len - 1;
|
|
57243
|
-
|
|
57244
|
-
const tailIsPct3D = (j) =>
|
|
57245
|
-
j >= 2 &&
|
|
57246
|
-
body.charCodeAt(j - 2) === 37 && // '%'
|
|
57247
|
-
body.charCodeAt(j - 1) === 51 && // '3'
|
|
57248
|
-
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
|
|
57249
|
-
|
|
57250
|
-
if (idx >= 0) {
|
|
57251
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
57252
|
-
pad++;
|
|
57253
|
-
idx--;
|
|
57254
|
-
} else if (tailIsPct3D(idx)) {
|
|
57255
|
-
pad++;
|
|
57256
|
-
idx -= 3;
|
|
57257
|
-
}
|
|
57258
|
-
}
|
|
57259
|
-
|
|
57260
|
-
if (pad === 1 && idx >= 0) {
|
|
57261
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
57262
|
-
pad++;
|
|
57263
|
-
} else if (tailIsPct3D(idx)) {
|
|
57264
|
-
pad++;
|
|
57265
|
-
}
|
|
57266
|
-
}
|
|
57267
|
-
|
|
57268
|
-
const groups = Math.floor(effectiveLen / 4);
|
|
57269
|
-
const bytes = groups * 3 - (pad || 0);
|
|
57270
|
-
return bytes > 0 ? bytes : 0;
|
|
57271
|
-
}
|
|
57272
|
-
|
|
57273
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
|
|
57274
|
-
return Buffer.byteLength(body, 'utf8');
|
|
57275
|
-
}
|
|
57276
|
-
|
|
57277
|
-
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
57278
|
-
// a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
|
|
57279
|
-
// Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
|
|
57280
|
-
// but 3 UTF-8 bytes).
|
|
57281
|
-
let bytes = 0;
|
|
57282
|
-
for (let i = 0, len = body.length; i < len; i++) {
|
|
57283
|
-
const c = body.charCodeAt(i);
|
|
57284
|
-
if (c < 0x80) {
|
|
57285
|
-
bytes += 1;
|
|
57286
|
-
} else if (c < 0x800) {
|
|
57287
|
-
bytes += 2;
|
|
57288
|
-
} else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
|
|
57289
|
-
const next = body.charCodeAt(i + 1);
|
|
57290
|
-
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
57291
|
-
bytes += 4;
|
|
57292
|
-
i++;
|
|
57293
|
-
} else {
|
|
57294
|
-
bytes += 3;
|
|
57295
|
-
}
|
|
57296
|
-
} else {
|
|
57297
|
-
bytes += 3;
|
|
57298
|
-
}
|
|
57299
|
-
}
|
|
57300
|
-
return bytes;
|
|
57301
|
-
}
|
|
57302
|
-
|
|
57303
|
-
const VERSION = "1.16.1";
|
|
57304
|
-
|
|
57305
56597
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
57306
56598
|
|
|
57307
56599
|
const { isFunction } = utils$1;
|
|
57308
56600
|
|
|
56601
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
56602
|
+
Request,
|
|
56603
|
+
Response,
|
|
56604
|
+
}))(utils$1.global);
|
|
56605
|
+
|
|
56606
|
+
const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
|
|
56607
|
+
|
|
57309
56608
|
const test = (fn, ...args) => {
|
|
57310
56609
|
try {
|
|
57311
56610
|
return !!fn(...args);
|
|
@@ -57315,20 +56614,11 @@ const test = (fn, ...args) => {
|
|
|
57315
56614
|
};
|
|
57316
56615
|
|
|
57317
56616
|
const factory = (env) => {
|
|
57318
|
-
const globalObject =
|
|
57319
|
-
utils$1.global !== undefined && utils$1.global !== null
|
|
57320
|
-
? utils$1.global
|
|
57321
|
-
: globalThis;
|
|
57322
|
-
const { ReadableStream, TextEncoder } = globalObject;
|
|
57323
|
-
|
|
57324
56617
|
env = utils$1.merge.call(
|
|
57325
56618
|
{
|
|
57326
56619
|
skipUndefined: true,
|
|
57327
56620
|
},
|
|
57328
|
-
|
|
57329
|
-
Request: globalObject.Request,
|
|
57330
|
-
Response: globalObject.Response,
|
|
57331
|
-
},
|
|
56621
|
+
globalFetchAPI,
|
|
57332
56622
|
env
|
|
57333
56623
|
);
|
|
57334
56624
|
|
|
@@ -57341,7 +56631,7 @@ const factory = (env) => {
|
|
|
57341
56631
|
return false;
|
|
57342
56632
|
}
|
|
57343
56633
|
|
|
57344
|
-
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
|
|
56634
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
57345
56635
|
|
|
57346
56636
|
const encodeText =
|
|
57347
56637
|
isFetchSupported &&
|
|
@@ -57359,7 +56649,7 @@ const factory = (env) => {
|
|
|
57359
56649
|
let duplexAccessed = false;
|
|
57360
56650
|
|
|
57361
56651
|
const request = new Request(platform.origin, {
|
|
57362
|
-
body: new ReadableStream(),
|
|
56652
|
+
body: new ReadableStream$1(),
|
|
57363
56653
|
method: 'POST',
|
|
57364
56654
|
get duplex() {
|
|
57365
56655
|
duplexAccessed = true;
|
|
@@ -57455,13 +56745,8 @@ const factory = (env) => {
|
|
|
57455
56745
|
headers,
|
|
57456
56746
|
withCredentials = 'same-origin',
|
|
57457
56747
|
fetchOptions,
|
|
57458
|
-
maxContentLength,
|
|
57459
|
-
maxBodyLength,
|
|
57460
56748
|
} = resolveConfig(config);
|
|
57461
56749
|
|
|
57462
|
-
const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
57463
|
-
const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
57464
|
-
|
|
57465
56750
|
let _fetch = envFetch || fetch;
|
|
57466
56751
|
|
|
57467
56752
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
@@ -57483,41 +56768,6 @@ const factory = (env) => {
|
|
|
57483
56768
|
let requestContentLength;
|
|
57484
56769
|
|
|
57485
56770
|
try {
|
|
57486
|
-
// Enforce maxContentLength for data: URLs up-front so we never materialize
|
|
57487
|
-
// an oversized payload. The HTTP adapter applies the same check (see http.js
|
|
57488
|
-
// "if (protocol === 'data:')" branch).
|
|
57489
|
-
if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
|
|
57490
|
-
const estimated = estimateDataURLDecodedBytes(url);
|
|
57491
|
-
if (estimated > maxContentLength) {
|
|
57492
|
-
throw new AxiosError(
|
|
57493
|
-
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
57494
|
-
AxiosError.ERR_BAD_RESPONSE,
|
|
57495
|
-
config,
|
|
57496
|
-
request
|
|
57497
|
-
);
|
|
57498
|
-
}
|
|
57499
|
-
}
|
|
57500
|
-
|
|
57501
|
-
// Enforce maxBodyLength against the outbound request body before dispatch.
|
|
57502
|
-
// Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
|
|
57503
|
-
// maxBodyLength limit'). Skip when the body length cannot be determined
|
|
57504
|
-
// (e.g. a live ReadableStream supplied by the caller).
|
|
57505
|
-
if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
|
|
57506
|
-
const outboundLength = await resolveBodyLength(headers, data);
|
|
57507
|
-
if (
|
|
57508
|
-
typeof outboundLength === 'number' &&
|
|
57509
|
-
isFinite(outboundLength) &&
|
|
57510
|
-
outboundLength > maxBodyLength
|
|
57511
|
-
) {
|
|
57512
|
-
throw new AxiosError(
|
|
57513
|
-
'Request body larger than maxBodyLength limit',
|
|
57514
|
-
AxiosError.ERR_BAD_REQUEST,
|
|
57515
|
-
config,
|
|
57516
|
-
request
|
|
57517
|
-
);
|
|
57518
|
-
}
|
|
57519
|
-
}
|
|
57520
|
-
|
|
57521
56771
|
if (
|
|
57522
56772
|
onUploadProgress &&
|
|
57523
56773
|
supportsRequestStream &&
|
|
@@ -57568,14 +56818,11 @@ const factory = (env) => {
|
|
|
57568
56818
|
}
|
|
57569
56819
|
}
|
|
57570
56820
|
|
|
57571
|
-
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
|
57572
|
-
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
57573
|
-
|
|
57574
56821
|
const resolvedOptions = {
|
|
57575
56822
|
...fetchOptions,
|
|
57576
56823
|
signal: composedSignal,
|
|
57577
56824
|
method: method.toUpperCase(),
|
|
57578
|
-
headers:
|
|
56825
|
+
headers: headers.normalize().toJSON(),
|
|
57579
56826
|
body: data,
|
|
57580
56827
|
duplex: 'half',
|
|
57581
56828
|
credentials: isCredentialsSupported ? withCredentials : undefined,
|
|
@@ -57587,28 +56834,10 @@ const factory = (env) => {
|
|
|
57587
56834
|
? _fetch(request, fetchOptions)
|
|
57588
56835
|
: _fetch(url, resolvedOptions));
|
|
57589
56836
|
|
|
57590
|
-
// Cheap pre-check: if the server honestly declares a content-length that
|
|
57591
|
-
// already exceeds the cap, reject before we start streaming.
|
|
57592
|
-
if (hasMaxContentLength) {
|
|
57593
|
-
const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
57594
|
-
if (declaredLength != null && declaredLength > maxContentLength) {
|
|
57595
|
-
throw new AxiosError(
|
|
57596
|
-
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
57597
|
-
AxiosError.ERR_BAD_RESPONSE,
|
|
57598
|
-
config,
|
|
57599
|
-
request
|
|
57600
|
-
);
|
|
57601
|
-
}
|
|
57602
|
-
}
|
|
57603
|
-
|
|
57604
56837
|
const isStreamResponse =
|
|
57605
56838
|
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
57606
56839
|
|
|
57607
|
-
if (
|
|
57608
|
-
supportsResponseStream &&
|
|
57609
|
-
response.body &&
|
|
57610
|
-
(onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
|
|
57611
|
-
) {
|
|
56840
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
57612
56841
|
const options = {};
|
|
57613
56842
|
|
|
57614
56843
|
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
@@ -57625,24 +56854,8 @@ const factory = (env) => {
|
|
|
57625
56854
|
)) ||
|
|
57626
56855
|
[];
|
|
57627
56856
|
|
|
57628
|
-
let bytesRead = 0;
|
|
57629
|
-
const onChunkProgress = (loadedBytes) => {
|
|
57630
|
-
if (hasMaxContentLength) {
|
|
57631
|
-
bytesRead = loadedBytes;
|
|
57632
|
-
if (bytesRead > maxContentLength) {
|
|
57633
|
-
throw new AxiosError(
|
|
57634
|
-
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
57635
|
-
AxiosError.ERR_BAD_RESPONSE,
|
|
57636
|
-
config,
|
|
57637
|
-
request
|
|
57638
|
-
);
|
|
57639
|
-
}
|
|
57640
|
-
}
|
|
57641
|
-
onProgress && onProgress(loadedBytes);
|
|
57642
|
-
};
|
|
57643
|
-
|
|
57644
56857
|
response = new Response(
|
|
57645
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE,
|
|
56858
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
57646
56859
|
flush && flush();
|
|
57647
56860
|
unsubscribe && unsubscribe();
|
|
57648
56861
|
}),
|
|
@@ -57657,33 +56870,6 @@ const factory = (env) => {
|
|
|
57657
56870
|
config
|
|
57658
56871
|
);
|
|
57659
56872
|
|
|
57660
|
-
// Fallback enforcement for environments without ReadableStream support
|
|
57661
|
-
// (legacy runtimes). Detect materialized size from typed output; skip
|
|
57662
|
-
// streams/Response passthrough since the user will read those themselves.
|
|
57663
|
-
if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
|
|
57664
|
-
let materializedSize;
|
|
57665
|
-
if (responseData != null) {
|
|
57666
|
-
if (typeof responseData.byteLength === 'number') {
|
|
57667
|
-
materializedSize = responseData.byteLength;
|
|
57668
|
-
} else if (typeof responseData.size === 'number') {
|
|
57669
|
-
materializedSize = responseData.size;
|
|
57670
|
-
} else if (typeof responseData === 'string') {
|
|
57671
|
-
materializedSize =
|
|
57672
|
-
typeof TextEncoder === 'function'
|
|
57673
|
-
? new TextEncoder().encode(responseData).byteLength
|
|
57674
|
-
: responseData.length;
|
|
57675
|
-
}
|
|
57676
|
-
}
|
|
57677
|
-
if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
|
|
57678
|
-
throw new AxiosError(
|
|
57679
|
-
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
57680
|
-
AxiosError.ERR_BAD_RESPONSE,
|
|
57681
|
-
config,
|
|
57682
|
-
request
|
|
57683
|
-
);
|
|
57684
|
-
}
|
|
57685
|
-
}
|
|
57686
|
-
|
|
57687
56873
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
57688
56874
|
|
|
57689
56875
|
return await new Promise((resolve, reject) => {
|
|
@@ -57699,17 +56885,6 @@ const factory = (env) => {
|
|
|
57699
56885
|
} catch (err) {
|
|
57700
56886
|
unsubscribe && unsubscribe();
|
|
57701
56887
|
|
|
57702
|
-
// Safari can surface fetch aborts as a DOMException-like object whose
|
|
57703
|
-
// branded getters throw. Prefer our composed signal reason before reading
|
|
57704
|
-
// the caught error, preserving timeout vs cancellation semantics.
|
|
57705
|
-
if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {
|
|
57706
|
-
const canceledError = composedSignal.reason;
|
|
57707
|
-
canceledError.config = config;
|
|
57708
|
-
request && (canceledError.request = request);
|
|
57709
|
-
err !== canceledError && (canceledError.cause = err);
|
|
57710
|
-
throw canceledError;
|
|
57711
|
-
}
|
|
57712
|
-
|
|
57713
56888
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
57714
56889
|
throw Object.assign(
|
|
57715
56890
|
new AxiosError(
|
|
@@ -57778,13 +56953,11 @@ const knownAdapters = {
|
|
|
57778
56953
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
57779
56954
|
if (fn) {
|
|
57780
56955
|
try {
|
|
57781
|
-
|
|
57782
|
-
// these data descriptors into accessor descriptors on the way in.
|
|
57783
|
-
Object.defineProperty(fn, 'name', { __proto__: null, value });
|
|
56956
|
+
Object.defineProperty(fn, 'name', { value });
|
|
57784
56957
|
} catch (e) {
|
|
57785
56958
|
// eslint-disable-next-line no-empty
|
|
57786
56959
|
}
|
|
57787
|
-
Object.defineProperty(fn, 'adapterName', {
|
|
56960
|
+
Object.defineProperty(fn, 'adapterName', { value });
|
|
57788
56961
|
}
|
|
57789
56962
|
});
|
|
57790
56963
|
|
|
@@ -57926,15 +57099,8 @@ function dispatchRequest(config) {
|
|
|
57926
57099
|
function onAdapterResolution(response) {
|
|
57927
57100
|
throwIfCancellationRequested(config);
|
|
57928
57101
|
|
|
57929
|
-
//
|
|
57930
|
-
|
|
57931
|
-
// We clean it up afterwards to avoid polluting the config object.
|
|
57932
|
-
config.response = response;
|
|
57933
|
-
try {
|
|
57934
|
-
response.data = transformData.call(config, config.transformResponse, response);
|
|
57935
|
-
} finally {
|
|
57936
|
-
delete config.response;
|
|
57937
|
-
}
|
|
57102
|
+
// Transform response data
|
|
57103
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
57938
57104
|
|
|
57939
57105
|
response.headers = AxiosHeaders.from(response.headers);
|
|
57940
57106
|
|
|
@@ -57946,16 +57112,11 @@ function dispatchRequest(config) {
|
|
|
57946
57112
|
|
|
57947
57113
|
// Transform response data
|
|
57948
57114
|
if (reason && reason.response) {
|
|
57949
|
-
|
|
57950
|
-
|
|
57951
|
-
|
|
57952
|
-
|
|
57953
|
-
|
|
57954
|
-
reason.response
|
|
57955
|
-
);
|
|
57956
|
-
} finally {
|
|
57957
|
-
delete config.response;
|
|
57958
|
-
}
|
|
57115
|
+
reason.response.data = transformData.call(
|
|
57116
|
+
config,
|
|
57117
|
+
config.transformResponse,
|
|
57118
|
+
reason.response
|
|
57119
|
+
);
|
|
57959
57120
|
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
57960
57121
|
}
|
|
57961
57122
|
}
|
|
@@ -57965,6 +57126,8 @@ function dispatchRequest(config) {
|
|
|
57965
57126
|
);
|
|
57966
57127
|
}
|
|
57967
57128
|
|
|
57129
|
+
const VERSION = "1.15.2";
|
|
57130
|
+
|
|
57968
57131
|
const validators$1 = {};
|
|
57969
57132
|
|
|
57970
57133
|
// eslint-disable-next-line func-names
|
|
@@ -58049,7 +57212,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
58049
57212
|
while (i-- > 0) {
|
|
58050
57213
|
const opt = keys[i];
|
|
58051
57214
|
// Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
|
|
58052
|
-
// a non-function validator and cause a TypeError.
|
|
57215
|
+
// a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
|
|
58053
57216
|
const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
|
|
58054
57217
|
if (validator) {
|
|
58055
57218
|
const value = options[opt];
|
|
@@ -58209,7 +57372,7 @@ class Axios {
|
|
|
58209
57372
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
58210
57373
|
|
|
58211
57374
|
headers &&
|
|
58212
|
-
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', '
|
|
57375
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
58213
57376
|
delete headers[method];
|
|
58214
57377
|
});
|
|
58215
57378
|
|
|
@@ -58312,7 +57475,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
|
|
|
58312
57475
|
};
|
|
58313
57476
|
});
|
|
58314
57477
|
|
|
58315
|
-
utils$1.forEach(['post', 'put', 'patch'
|
|
57478
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
58316
57479
|
function generateHTTPMethod(isForm) {
|
|
58317
57480
|
return function httpMethod(url, data, config) {
|
|
58318
57481
|
return this.request(
|
|
@@ -58332,11 +57495,7 @@ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithDat
|
|
|
58332
57495
|
|
|
58333
57496
|
Axios.prototype[method] = generateHTTPMethod();
|
|
58334
57497
|
|
|
58335
|
-
|
|
58336
|
-
// its semantics, so no queryForm shorthand is generated.
|
|
58337
|
-
if (method !== 'query') {
|
|
58338
|
-
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
58339
|
-
}
|
|
57498
|
+
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
58340
57499
|
});
|
|
58341
57500
|
|
|
58342
57501
|
/**
|
|
@@ -62241,12 +61400,12 @@ const WinLoseSummary = ({ data, id, filter, showUsd }) => {
|
|
|
62241
61400
|
] }),
|
|
62242
61401
|
winLoses.map(({ winLoseKhr: winLoseKhr2, winLoseUsd: winLoseUsd2, lotteryType, share }, index) => {
|
|
62243
61402
|
const lotteryName = lotteryLabelKH[lotteryType] || lotteryType;
|
|
62244
|
-
const
|
|
61403
|
+
const lotteryCode = lotteryCodes[lotteryType] || lotteryType;
|
|
62245
61404
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62246
61405
|
SummaryRow,
|
|
62247
61406
|
{
|
|
62248
61407
|
id,
|
|
62249
|
-
label: `\u1786\u17D2\u1793\u17C4\u178F${lotteryName} (${
|
|
61408
|
+
label: `\u1786\u17D2\u1793\u17C4\u178F${lotteryName} (${lotteryCode})`,
|
|
62250
61409
|
khr: winLoseKhr2,
|
|
62251
61410
|
usd: winLoseUsd2,
|
|
62252
61411
|
showUsd,
|