@rebilly/instruments 16.170.0 → 16.170.1
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/CHANGELOG.md +1 -6
- package/dist/index.js +350 -93
- package/dist/index.min.js +9 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2340,6 +2340,7 @@ const isReactNativeBlob = (value) => {
|
|
|
2340
2340
|
const isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
|
|
2341
2341
|
const isBlob = kindOfTest("Blob");
|
|
2342
2342
|
const isFileList = kindOfTest("FileList");
|
|
2343
|
+
const isSet = kindOfTest("Set");
|
|
2343
2344
|
const isStream = (val) => isObject$1(val) && isFunction$1(val.pipe);
|
|
2344
2345
|
function getGlobal() {
|
|
2345
2346
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
@@ -2635,11 +2636,20 @@ const toJSONObject = (obj) => {
|
|
|
2635
2636
|
}
|
|
2636
2637
|
if (!("toJSON" in source)) {
|
|
2637
2638
|
visited.add(source);
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2639
|
+
let target;
|
|
2640
|
+
if (isSet(source)) {
|
|
2641
|
+
target = [];
|
|
2642
|
+
for (const value of source) {
|
|
2643
|
+
const reducedValue = visit(value);
|
|
2644
|
+
!isUndefined(reducedValue) && target.push(reducedValue);
|
|
2645
|
+
}
|
|
2646
|
+
} else {
|
|
2647
|
+
target = isArray(source) ? [] : {};
|
|
2648
|
+
forEach(source, (value, key) => {
|
|
2649
|
+
const reducedValue = visit(value);
|
|
2650
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2643
2653
|
visited.delete(source);
|
|
2644
2654
|
return target;
|
|
2645
2655
|
}
|
|
@@ -2766,17 +2776,18 @@ const parseHeaders = (rawHeaders) => {
|
|
|
2766
2776
|
i = line.indexOf(":");
|
|
2767
2777
|
key = line.substring(0, i).trim().toLowerCase();
|
|
2768
2778
|
val = line.substring(i + 1).trim();
|
|
2769
|
-
|
|
2779
|
+
const hasKey = utils$1.hasOwnProp(parsed, key);
|
|
2780
|
+
if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) {
|
|
2770
2781
|
return;
|
|
2771
2782
|
}
|
|
2772
2783
|
if (key === "set-cookie") {
|
|
2773
|
-
if (
|
|
2784
|
+
if (hasKey) {
|
|
2774
2785
|
parsed[key].push(val);
|
|
2775
2786
|
} else {
|
|
2776
2787
|
parsed[key] = [val];
|
|
2777
2788
|
}
|
|
2778
2789
|
} else {
|
|
2779
|
-
parsed[key] =
|
|
2790
|
+
parsed[key] = hasKey ? parsed[key] + ", " + val : val;
|
|
2780
2791
|
}
|
|
2781
2792
|
});
|
|
2782
2793
|
return parsed;
|
|
@@ -2836,6 +2847,90 @@ function parseTokens(str) {
|
|
|
2836
2847
|
}
|
|
2837
2848
|
return tokens;
|
|
2838
2849
|
}
|
|
2850
|
+
const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
2851
|
+
function trimOWS(value) {
|
|
2852
|
+
let start = 0;
|
|
2853
|
+
let end = value.length;
|
|
2854
|
+
while (start < end) {
|
|
2855
|
+
const code = value.charCodeAt(start);
|
|
2856
|
+
if (code !== 9 && code !== 32) {
|
|
2857
|
+
break;
|
|
2858
|
+
}
|
|
2859
|
+
start += 1;
|
|
2860
|
+
}
|
|
2861
|
+
while (end > start) {
|
|
2862
|
+
const code = value.charCodeAt(end - 1);
|
|
2863
|
+
if (code !== 9 && code !== 32) {
|
|
2864
|
+
break;
|
|
2865
|
+
}
|
|
2866
|
+
end -= 1;
|
|
2867
|
+
}
|
|
2868
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
2869
|
+
}
|
|
2870
|
+
function decodeQuotedString(value) {
|
|
2871
|
+
const last = value.length - 1;
|
|
2872
|
+
if (last < 1 || value.charCodeAt(0) !== 34 || value.charCodeAt(last) !== 34) {
|
|
2873
|
+
return value;
|
|
2874
|
+
}
|
|
2875
|
+
let decoded = "";
|
|
2876
|
+
for (let i = 1; i < last; i++) {
|
|
2877
|
+
const code = value.charCodeAt(i);
|
|
2878
|
+
if (code === 34) {
|
|
2879
|
+
return value;
|
|
2880
|
+
}
|
|
2881
|
+
if (code === 92) {
|
|
2882
|
+
i += 1;
|
|
2883
|
+
if (i >= last) {
|
|
2884
|
+
return value;
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
decoded += value[i];
|
|
2888
|
+
}
|
|
2889
|
+
return decoded;
|
|
2890
|
+
}
|
|
2891
|
+
function parseParameters(value) {
|
|
2892
|
+
const parameters = /* @__PURE__ */ Object.create(null);
|
|
2893
|
+
const str = String(value);
|
|
2894
|
+
let start = 0;
|
|
2895
|
+
let quoted = false;
|
|
2896
|
+
let escaped = false;
|
|
2897
|
+
function parseParameter(end) {
|
|
2898
|
+
const part = trimOWS(str.slice(start, end));
|
|
2899
|
+
const equals = part.indexOf("=");
|
|
2900
|
+
if (equals < 1) {
|
|
2901
|
+
return;
|
|
2902
|
+
}
|
|
2903
|
+
const name = trimOWS(part.slice(0, equals));
|
|
2904
|
+
if (!parameterNameRE.test(name)) {
|
|
2905
|
+
return;
|
|
2906
|
+
}
|
|
2907
|
+
const normalizedName = name.toLowerCase();
|
|
2908
|
+
if (normalizedName === "__proto__" || normalizedName === "constructor" || normalizedName === "prototype") {
|
|
2909
|
+
return;
|
|
2910
|
+
}
|
|
2911
|
+
const parameterValue = trimOWS(part.slice(equals + 1));
|
|
2912
|
+
parameters[normalizedName] = decodeQuotedString(parameterValue);
|
|
2913
|
+
}
|
|
2914
|
+
for (let i = 0; i < str.length; i++) {
|
|
2915
|
+
const code = str.charCodeAt(i);
|
|
2916
|
+
if (quoted) {
|
|
2917
|
+
if (escaped) {
|
|
2918
|
+
escaped = false;
|
|
2919
|
+
} else if (code === 92) {
|
|
2920
|
+
escaped = true;
|
|
2921
|
+
} else if (code === 34) {
|
|
2922
|
+
quoted = false;
|
|
2923
|
+
}
|
|
2924
|
+
} else if (code === 34) {
|
|
2925
|
+
quoted = true;
|
|
2926
|
+
} else if (code === 44 || code === 59) {
|
|
2927
|
+
parseParameter(i);
|
|
2928
|
+
start = i + 1;
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
parseParameter(str.length);
|
|
2932
|
+
return parameters;
|
|
2933
|
+
}
|
|
2839
2934
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
2840
2935
|
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
2841
2936
|
if (utils$1.isFunction(filter2)) {
|
|
@@ -3011,7 +3106,8 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
3011
3106
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
3012
3107
|
}
|
|
3013
3108
|
getSetCookie() {
|
|
3014
|
-
|
|
3109
|
+
const value = this.get("set-cookie");
|
|
3110
|
+
return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value];
|
|
3015
3111
|
}
|
|
3016
3112
|
get [Symbol.toStringTag]() {
|
|
3017
3113
|
return "AxiosHeaders";
|
|
@@ -3019,6 +3115,9 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
3019
3115
|
static from(thing) {
|
|
3020
3116
|
return thing instanceof this ? thing : new this(thing);
|
|
3021
3117
|
}
|
|
3118
|
+
static parseParameters(value) {
|
|
3119
|
+
return parseParameters(value);
|
|
3120
|
+
}
|
|
3022
3121
|
static concat(first, ...targets) {
|
|
3023
3122
|
const computed = new this(first);
|
|
3024
3123
|
targets.forEach((target) => computed.set(target));
|
|
@@ -3111,10 +3210,37 @@ function redactConfig(config, redactKeys) {
|
|
|
3111
3210
|
};
|
|
3112
3211
|
return visit(config);
|
|
3113
3212
|
}
|
|
3213
|
+
function stringifySafely$1(value) {
|
|
3214
|
+
try {
|
|
3215
|
+
return String(value);
|
|
3216
|
+
} catch (err) {
|
|
3217
|
+
return "";
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
function aggregateErrorMessage(error) {
|
|
3221
|
+
const message = error.errors.map((entry) => {
|
|
3222
|
+
try {
|
|
3223
|
+
return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry);
|
|
3224
|
+
} catch (err) {
|
|
3225
|
+
return "";
|
|
3226
|
+
}
|
|
3227
|
+
}).filter(Boolean).join("; ");
|
|
3228
|
+
return message || error.name || "AggregateError";
|
|
3229
|
+
}
|
|
3114
3230
|
let AxiosError$1 = class AxiosError extends Error {
|
|
3115
3231
|
static from(error, code, config, request, response, customProps) {
|
|
3116
|
-
|
|
3117
|
-
|
|
3232
|
+
let message = error.message;
|
|
3233
|
+
if (!message && utils$1.isArray(error.errors) && error.errors.length) {
|
|
3234
|
+
message = aggregateErrorMessage(error);
|
|
3235
|
+
}
|
|
3236
|
+
const axiosError = new AxiosError(message, code || error.code, config, request, response);
|
|
3237
|
+
Object.defineProperty(axiosError, "cause", {
|
|
3238
|
+
__proto__: null,
|
|
3239
|
+
value: error,
|
|
3240
|
+
writable: true,
|
|
3241
|
+
enumerable: false,
|
|
3242
|
+
configurable: true
|
|
3243
|
+
});
|
|
3118
3244
|
axiosError.name = error.name;
|
|
3119
3245
|
if (error.status != null && axiosError.status == null) {
|
|
3120
3246
|
axiosError.status = error.status;
|
|
@@ -3252,7 +3378,10 @@ function toFormData$1(obj, formData, options) {
|
|
|
3252
3378
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
3253
3379
|
}
|
|
3254
3380
|
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
3255
|
-
|
|
3381
|
+
if (useBlob && typeof _Blob === "function") {
|
|
3382
|
+
return new _Blob([value]);
|
|
3383
|
+
}
|
|
3384
|
+
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.", AxiosError$1.ERR_NOT_SUPPORT);
|
|
3256
3385
|
}
|
|
3257
3386
|
return value;
|
|
3258
3387
|
}
|
|
@@ -3357,9 +3486,7 @@ prototype.append = function append(name, value) {
|
|
|
3357
3486
|
this._pairs.push([name, value]);
|
|
3358
3487
|
};
|
|
3359
3488
|
prototype.toString = function toString2(encoder) {
|
|
3360
|
-
const _encode = encoder ?
|
|
3361
|
-
return encoder.call(this, value, encode$1);
|
|
3362
|
-
} : encode$1;
|
|
3489
|
+
const _encode = encoder ? (value) => encoder.call(this, value, encode$1) : encode$1;
|
|
3363
3490
|
return this._pairs.map(function each(pair) {
|
|
3364
3491
|
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
3365
3492
|
}, "").join("&");
|
|
@@ -3371,6 +3498,7 @@ function buildURL(url, params, options) {
|
|
|
3371
3498
|
if (!params) {
|
|
3372
3499
|
return url;
|
|
3373
3500
|
}
|
|
3501
|
+
url = url || "";
|
|
3374
3502
|
const _options = utils$1.isFunction(options) ? {
|
|
3375
3503
|
serialize: options
|
|
3376
3504
|
} : options;
|
|
@@ -3516,7 +3644,7 @@ function throwIfDepthExceeded(index2) {
|
|
|
3516
3644
|
}
|
|
3517
3645
|
function parsePropPath(name) {
|
|
3518
3646
|
const path = [];
|
|
3519
|
-
const pattern2 =
|
|
3647
|
+
const pattern2 = /[^.[\]]+|\[([^.[\]]*)]/g;
|
|
3520
3648
|
let match;
|
|
3521
3649
|
while ((match = pattern2.exec(name)) !== null) {
|
|
3522
3650
|
throwIfDepthExceeded(path.length);
|
|
@@ -3806,7 +3934,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
3806
3934
|
}
|
|
3807
3935
|
const rawLoaded = e2.loaded;
|
|
3808
3936
|
const total = e2.lengthComputable ? e2.total : void 0;
|
|
3809
|
-
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
3937
|
+
const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
|
|
3810
3938
|
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
3811
3939
|
const rate = _speedometer(progressBytes);
|
|
3812
3940
|
bytesNotified = Math.max(bytesNotified, loaded);
|
|
@@ -3835,7 +3963,7 @@ const progressEventDecorator = (total, throttled) => {
|
|
|
3835
3963
|
throttled[1]
|
|
3836
3964
|
];
|
|
3837
3965
|
};
|
|
3838
|
-
const asyncDecorator = (fn) => (...args) =>
|
|
3966
|
+
const asyncDecorator = (fn, scheduler = utils$1.asap) => (...args) => scheduler(() => fn(...args));
|
|
3839
3967
|
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
|
|
3840
3968
|
url = new URL(url, platform.origin);
|
|
3841
3969
|
return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
|
|
@@ -3873,7 +4001,11 @@ const cookies = platform.hasStandardBrowserEnv ? (
|
|
|
3873
4001
|
const cookie = cookies2[i].replace(/^\s+/, "");
|
|
3874
4002
|
const eq = cookie.indexOf("=");
|
|
3875
4003
|
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
3876
|
-
|
|
4004
|
+
try {
|
|
4005
|
+
return decodeURIComponent(cookie.slice(eq + 1));
|
|
4006
|
+
} catch (e2) {
|
|
4007
|
+
return cookie.slice(eq + 1);
|
|
4008
|
+
}
|
|
3877
4009
|
}
|
|
3878
4010
|
}
|
|
3879
4011
|
return null;
|
|
@@ -3901,7 +4033,14 @@ function isAbsoluteURL(url) {
|
|
|
3901
4033
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
3902
4034
|
}
|
|
3903
4035
|
function combineURLs(baseURL, relativeURL) {
|
|
3904
|
-
|
|
4036
|
+
if (!relativeURL) {
|
|
4037
|
+
return baseURL;
|
|
4038
|
+
}
|
|
4039
|
+
let end = baseURL.length;
|
|
4040
|
+
while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
|
|
4041
|
+
end--;
|
|
4042
|
+
}
|
|
4043
|
+
return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
|
|
3905
4044
|
}
|
|
3906
4045
|
const malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
3907
4046
|
const httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
@@ -3915,13 +4054,37 @@ function stripLeadingC0ControlOrSpace(url) {
|
|
|
3915
4054
|
function normalizeURLForProtocolCheck(url) {
|
|
3916
4055
|
return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, "");
|
|
3917
4056
|
}
|
|
4057
|
+
function redactFragment(fragment) {
|
|
4058
|
+
if (!fragment) {
|
|
4059
|
+
return fragment;
|
|
4060
|
+
}
|
|
4061
|
+
return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = "") => {
|
|
4062
|
+
return `${separator}${parameterName}${REDACTED}`;
|
|
4063
|
+
});
|
|
4064
|
+
}
|
|
4065
|
+
function redactSensitiveURLParts(url) {
|
|
4066
|
+
const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);
|
|
4067
|
+
const fragmentIndex = redactedURL.indexOf("#");
|
|
4068
|
+
const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
|
|
4069
|
+
const redactedURLWithoutFragment = urlWithoutFragment.replace(
|
|
4070
|
+
/([?&][^=&#]*=)[^&#]*/g,
|
|
4071
|
+
`$1${REDACTED}`
|
|
4072
|
+
);
|
|
4073
|
+
if (fragmentIndex === -1) {
|
|
4074
|
+
return redactedURLWithoutFragment;
|
|
4075
|
+
}
|
|
4076
|
+
return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;
|
|
4077
|
+
}
|
|
3918
4078
|
function assertValidHttpProtocolURL(url, config) {
|
|
3919
|
-
if (typeof url === "string"
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
AxiosError$1
|
|
3923
|
-
|
|
3924
|
-
|
|
4079
|
+
if (typeof url === "string") {
|
|
4080
|
+
const normalizedURL = normalizeURLForProtocolCheck(url);
|
|
4081
|
+
if (malformedHttpProtocol.test(normalizedURL)) {
|
|
4082
|
+
throw new AxiosError$1(
|
|
4083
|
+
`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`,
|
|
4084
|
+
AxiosError$1.ERR_INVALID_URL,
|
|
4085
|
+
config
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
3925
4088
|
}
|
|
3926
4089
|
}
|
|
3927
4090
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
@@ -3934,7 +4097,18 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
|
3934
4097
|
return requestedURL;
|
|
3935
4098
|
}
|
|
3936
4099
|
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
4100
|
+
const ownEnumerableKeys = (thing) => {
|
|
4101
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
4102
|
+
return Object.keys(thing).concat(
|
|
4103
|
+
Object.getOwnPropertySymbols(thing).filter(
|
|
4104
|
+
(symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable
|
|
4105
|
+
)
|
|
4106
|
+
);
|
|
4107
|
+
}
|
|
4108
|
+
return Object.keys(thing);
|
|
4109
|
+
};
|
|
3937
4110
|
function mergeConfig$1(config1, config2) {
|
|
4111
|
+
config1 = config1 || {};
|
|
3938
4112
|
config2 = config2 || {};
|
|
3939
4113
|
const config = /* @__PURE__ */ Object.create(null);
|
|
3940
4114
|
Object.defineProperty(config, "hasOwnProperty", {
|
|
@@ -4031,7 +4205,7 @@ function mergeConfig$1(config1, config2) {
|
|
|
4031
4205
|
validateStatus: mergeDirectKeys,
|
|
4032
4206
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
4033
4207
|
};
|
|
4034
|
-
utils$1.forEach(
|
|
4208
|
+
utils$1.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
4035
4209
|
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
4036
4210
|
const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
4037
4211
|
const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : void 0;
|
|
@@ -4054,7 +4228,7 @@ function setFormDataHeaders(headers, formHeaders, policy) {
|
|
|
4054
4228
|
headers.set(formHeaders);
|
|
4055
4229
|
return;
|
|
4056
4230
|
}
|
|
4057
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
4231
|
+
Object.entries(formHeaders || {}).forEach(([key, val]) => {
|
|
4058
4232
|
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
4059
4233
|
headers.set(key, val);
|
|
4060
4234
|
}
|
|
@@ -4085,10 +4259,14 @@ function resolveConfig(config) {
|
|
|
4085
4259
|
if (auth) {
|
|
4086
4260
|
const username = utils$1.getSafeProp(auth, "username") || "";
|
|
4087
4261
|
const password = utils$1.getSafeProp(auth, "password") || "";
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4262
|
+
try {
|
|
4263
|
+
headers.set(
|
|
4264
|
+
"Authorization",
|
|
4265
|
+
"Basic " + btoa(username + ":" + (password ? encodeUTF8$1(password) : ""))
|
|
4266
|
+
);
|
|
4267
|
+
} catch (e2) {
|
|
4268
|
+
throw AxiosError$1.from(e2, AxiosError$1.ERR_BAD_OPTION_VALUE, config);
|
|
4269
|
+
}
|
|
4092
4270
|
}
|
|
4093
4271
|
if (utils$1.isFormData(data)) {
|
|
4094
4272
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
|
|
@@ -4250,6 +4428,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
4250
4428
|
config
|
|
4251
4429
|
)
|
|
4252
4430
|
);
|
|
4431
|
+
done();
|
|
4253
4432
|
return;
|
|
4254
4433
|
}
|
|
4255
4434
|
request.send(requestData || null);
|
|
@@ -4287,7 +4466,16 @@ const composeSignals = (signals, timeout) => {
|
|
|
4287
4466
|
});
|
|
4288
4467
|
signals = null;
|
|
4289
4468
|
};
|
|
4290
|
-
signals.forEach((signal2) =>
|
|
4469
|
+
signals.forEach((signal2) => {
|
|
4470
|
+
if (aborted) {
|
|
4471
|
+
return;
|
|
4472
|
+
}
|
|
4473
|
+
if (signal2.aborted) {
|
|
4474
|
+
onabort.call(signal2);
|
|
4475
|
+
return;
|
|
4476
|
+
}
|
|
4477
|
+
signal2.addEventListener("abort", onabort, { once: true });
|
|
4478
|
+
});
|
|
4291
4479
|
const { signal } = controller;
|
|
4292
4480
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
4293
4481
|
return signal;
|
|
@@ -4372,7 +4560,61 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
4372
4560
|
};
|
|
4373
4561
|
const isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
|
|
4374
4562
|
const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
4375
|
-
|
|
4563
|
+
const hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55;
|
|
4564
|
+
const isBase64Char = (charCode) => charCode >= 65 && charCode <= 90 || // A-Z
|
|
4565
|
+
charCode >= 97 && charCode <= 122 || // a-z
|
|
4566
|
+
charCode >= 48 && charCode <= 57 || // 0-9
|
|
4567
|
+
charCode === 43 || // +
|
|
4568
|
+
charCode === 47 || // /
|
|
4569
|
+
charCode === 45 || // - (base64url)
|
|
4570
|
+
charCode === 95;
|
|
4571
|
+
const isBase64Whitespace = (charCode) => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;
|
|
4572
|
+
const base64Bytes = (significant) => {
|
|
4573
|
+
const groups = Math.floor(significant / 4);
|
|
4574
|
+
const remainder = significant % 4;
|
|
4575
|
+
return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);
|
|
4576
|
+
};
|
|
4577
|
+
const estimateBase64BufferAllocation = (body) => {
|
|
4578
|
+
const len = body.length;
|
|
4579
|
+
let padding = 0;
|
|
4580
|
+
if (len > 0 && body.charCodeAt(len - 1) === 61) {
|
|
4581
|
+
padding++;
|
|
4582
|
+
if (len > 1 && body.charCodeAt(len - 2) === 61) {
|
|
4583
|
+
padding++;
|
|
4584
|
+
}
|
|
4585
|
+
}
|
|
4586
|
+
return Math.floor((len - padding) * 3 / 4);
|
|
4587
|
+
};
|
|
4588
|
+
const estimatePercentDecodedBase64Bytes = (body) => {
|
|
4589
|
+
const len = body.length;
|
|
4590
|
+
let significant = 0;
|
|
4591
|
+
let padding = 0;
|
|
4592
|
+
let invalid = false;
|
|
4593
|
+
for (let i = 0; i < len; i++) {
|
|
4594
|
+
let code = body.charCodeAt(i);
|
|
4595
|
+
if (code === 37 && isPercentEncodedByte(body, i, len)) {
|
|
4596
|
+
code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
|
|
4597
|
+
i += 2;
|
|
4598
|
+
}
|
|
4599
|
+
if (isBase64Whitespace(code)) {
|
|
4600
|
+
continue;
|
|
4601
|
+
}
|
|
4602
|
+
if (code === 61) {
|
|
4603
|
+
padding++;
|
|
4604
|
+
continue;
|
|
4605
|
+
}
|
|
4606
|
+
if (!isBase64Char(code) || padding > 0) {
|
|
4607
|
+
invalid = true;
|
|
4608
|
+
continue;
|
|
4609
|
+
}
|
|
4610
|
+
significant++;
|
|
4611
|
+
}
|
|
4612
|
+
if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) {
|
|
4613
|
+
return estimateBase64BufferAllocation(body);
|
|
4614
|
+
}
|
|
4615
|
+
return base64Bytes(significant);
|
|
4616
|
+
};
|
|
4617
|
+
const estimateDataURLBytes = (url, estimateBase64) => {
|
|
4376
4618
|
if (!url || typeof url !== "string") return 0;
|
|
4377
4619
|
if (!url.startsWith("data:")) return 0;
|
|
4378
4620
|
const comma = url.indexOf(",");
|
|
@@ -4381,43 +4623,7 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
4381
4623
|
const body = url.slice(comma + 1);
|
|
4382
4624
|
const isBase64 = /;base64/i.test(meta);
|
|
4383
4625
|
if (isBase64) {
|
|
4384
|
-
|
|
4385
|
-
const len = body.length;
|
|
4386
|
-
for (let i = 0; i < len; i++) {
|
|
4387
|
-
if (body.charCodeAt(i) === 37 && i + 2 < len) {
|
|
4388
|
-
const a = body.charCodeAt(i + 1);
|
|
4389
|
-
const b = body.charCodeAt(i + 2);
|
|
4390
|
-
const isHex = isHexDigit(a) && isHexDigit(b);
|
|
4391
|
-
if (isHex) {
|
|
4392
|
-
effectiveLen -= 2;
|
|
4393
|
-
i += 2;
|
|
4394
|
-
}
|
|
4395
|
-
}
|
|
4396
|
-
}
|
|
4397
|
-
let pad = 0;
|
|
4398
|
-
let idx = len - 1;
|
|
4399
|
-
const tailIsPct3D = (j2) => j2 >= 2 && body.charCodeAt(j2 - 2) === 37 && // '%'
|
|
4400
|
-
body.charCodeAt(j2 - 1) === 51 && // '3'
|
|
4401
|
-
(body.charCodeAt(j2) === 68 || body.charCodeAt(j2) === 100);
|
|
4402
|
-
if (idx >= 0) {
|
|
4403
|
-
if (body.charCodeAt(idx) === 61) {
|
|
4404
|
-
pad++;
|
|
4405
|
-
idx--;
|
|
4406
|
-
} else if (tailIsPct3D(idx)) {
|
|
4407
|
-
pad++;
|
|
4408
|
-
idx -= 3;
|
|
4409
|
-
}
|
|
4410
|
-
}
|
|
4411
|
-
if (pad === 1 && idx >= 0) {
|
|
4412
|
-
if (body.charCodeAt(idx) === 61) {
|
|
4413
|
-
pad++;
|
|
4414
|
-
} else if (tailIsPct3D(idx)) {
|
|
4415
|
-
pad++;
|
|
4416
|
-
}
|
|
4417
|
-
}
|
|
4418
|
-
const groups = Math.floor(effectiveLen / 4);
|
|
4419
|
-
const bytes2 = groups * 3 - (pad || 0);
|
|
4420
|
-
return bytes2 > 0 ? bytes2 : 0;
|
|
4626
|
+
return estimateBase64(body);
|
|
4421
4627
|
}
|
|
4422
4628
|
let bytes = 0;
|
|
4423
4629
|
for (let i = 0, len = body.length; i < len; i++) {
|
|
@@ -4442,8 +4648,15 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
4442
4648
|
}
|
|
4443
4649
|
}
|
|
4444
4650
|
return bytes;
|
|
4651
|
+
};
|
|
4652
|
+
function estimateDataURLDecodedBytes(url) {
|
|
4653
|
+
const fragmentIndex = typeof url === "string" ? url.indexOf("#") : -1;
|
|
4654
|
+
return estimateDataURLBytes(
|
|
4655
|
+
fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),
|
|
4656
|
+
estimatePercentDecodedBase64Bytes
|
|
4657
|
+
);
|
|
4445
4658
|
}
|
|
4446
|
-
const VERSION$1 = "1.
|
|
4659
|
+
const VERSION$1 = "1.19.0";
|
|
4447
4660
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
4448
4661
|
const { isFunction } = utils$1;
|
|
4449
4662
|
const encodeUTF8 = (str) => encodeURIComponent(str).replace(
|
|
@@ -4804,7 +5017,15 @@ const factory = (env) => {
|
|
|
4804
5017
|
const canceledError = composedSignal.reason;
|
|
4805
5018
|
canceledError.config = config;
|
|
4806
5019
|
request && (canceledError.request = request);
|
|
4807
|
-
err !== canceledError
|
|
5020
|
+
if (err !== canceledError) {
|
|
5021
|
+
Object.defineProperty(canceledError, "cause", {
|
|
5022
|
+
__proto__: null,
|
|
5023
|
+
value: err,
|
|
5024
|
+
writable: true,
|
|
5025
|
+
enumerable: false,
|
|
5026
|
+
configurable: true
|
|
5027
|
+
});
|
|
5028
|
+
}
|
|
4808
5029
|
throw canceledError;
|
|
4809
5030
|
}
|
|
4810
5031
|
if (pendingBodyError) {
|
|
@@ -4816,18 +5037,21 @@ const factory = (env) => {
|
|
|
4816
5037
|
throw err;
|
|
4817
5038
|
}
|
|
4818
5039
|
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
err && err.response
|
|
4826
|
-
),
|
|
4827
|
-
{
|
|
4828
|
-
cause: err.cause || err
|
|
4829
|
-
}
|
|
5040
|
+
const networkError = new AxiosError$1(
|
|
5041
|
+
"Network Error",
|
|
5042
|
+
AxiosError$1.ERR_NETWORK,
|
|
5043
|
+
config,
|
|
5044
|
+
request,
|
|
5045
|
+
err && err.response
|
|
4830
5046
|
);
|
|
5047
|
+
Object.defineProperty(networkError, "cause", {
|
|
5048
|
+
__proto__: null,
|
|
5049
|
+
value: err.cause || err,
|
|
5050
|
+
writable: true,
|
|
5051
|
+
enumerable: false,
|
|
5052
|
+
configurable: true
|
|
5053
|
+
});
|
|
5054
|
+
throw networkError;
|
|
4831
5055
|
}
|
|
4832
5056
|
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
4833
5057
|
}
|
|
@@ -4894,7 +5118,7 @@ function getAdapter$1(adapters2, config) {
|
|
|
4894
5118
|
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
4895
5119
|
throw new AxiosError$1(
|
|
4896
5120
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
4897
|
-
|
|
5121
|
+
AxiosError$1.ERR_NOT_SUPPORT
|
|
4898
5122
|
);
|
|
4899
5123
|
}
|
|
4900
5124
|
return adapter;
|
|
@@ -4997,7 +5221,7 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
4997
5221
|
};
|
|
4998
5222
|
};
|
|
4999
5223
|
function assertOptions(options, schema, allowUnknown) {
|
|
5000
|
-
if (typeof options !== "object") {
|
|
5224
|
+
if (typeof options !== "object" || options === null) {
|
|
5001
5225
|
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
5002
5226
|
}
|
|
5003
5227
|
const keys = Object.keys(options);
|
|
@@ -5171,16 +5395,31 @@ let Axios$1 = class Axios {
|
|
|
5171
5395
|
const onFulfilled = requestInterceptorChain[i++];
|
|
5172
5396
|
const onRejected = requestInterceptorChain[i++];
|
|
5173
5397
|
try {
|
|
5174
|
-
newConfig = onFulfilled(newConfig);
|
|
5398
|
+
newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;
|
|
5175
5399
|
} catch (error) {
|
|
5176
|
-
onRejected
|
|
5400
|
+
if (!onRejected) {
|
|
5401
|
+
promise = Promise.reject(error);
|
|
5402
|
+
break;
|
|
5403
|
+
}
|
|
5404
|
+
try {
|
|
5405
|
+
const rejectedResult = onRejected.call(this, error);
|
|
5406
|
+
if (utils$1.isThenable(rejectedResult)) {
|
|
5407
|
+
promise = Promise.resolve(rejectedResult).then(
|
|
5408
|
+
() => dispatchRequest.call(this, newConfig)
|
|
5409
|
+
);
|
|
5410
|
+
}
|
|
5411
|
+
} catch (rejectedError) {
|
|
5412
|
+
promise = Promise.reject(rejectedError);
|
|
5413
|
+
}
|
|
5177
5414
|
break;
|
|
5178
5415
|
}
|
|
5179
5416
|
}
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5417
|
+
if (!promise) {
|
|
5418
|
+
try {
|
|
5419
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
5420
|
+
} catch (error) {
|
|
5421
|
+
promise = Promise.reject(error);
|
|
5422
|
+
}
|
|
5184
5423
|
}
|
|
5185
5424
|
i = 0;
|
|
5186
5425
|
len = responseInterceptorChain.length;
|
|
@@ -5393,6 +5632,7 @@ const HttpStatusCode$1 = {
|
|
|
5393
5632
|
LoopDetected: 508,
|
|
5394
5633
|
NotExtended: 510,
|
|
5395
5634
|
NetworkAuthenticationRequired: 511,
|
|
5635
|
+
WebServerReturnsAnUnknownError: 520,
|
|
5396
5636
|
WebServerIsDown: 521,
|
|
5397
5637
|
ConnectionTimedOut: 522,
|
|
5398
5638
|
OriginIsUnreachable: 523,
|
|
@@ -5935,7 +6175,7 @@ function O$1({ options: e2 }) {
|
|
|
5935
6175
|
}
|
|
5936
6176
|
function o2() {
|
|
5937
6177
|
const a = {
|
|
5938
|
-
"REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((m2) => m2).join("/")}@
|
|
6178
|
+
"REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((m2) => m2).join("/")}@c1aeb51`
|
|
5939
6179
|
};
|
|
5940
6180
|
return e2.apiKey && (a["REB-APIKEY"] = e2.apiKey), a;
|
|
5941
6181
|
}
|
|
@@ -11394,32 +11634,46 @@ function we(e2, t2) {
|
|
|
11394
11634
|
switch (o2 = [0, 0], c = [0, 0], n2) {
|
|
11395
11635
|
case 15:
|
|
11396
11636
|
c = h(c, L([0, e2.charCodeAt(u + 14)], 48));
|
|
11637
|
+
// fallthrough
|
|
11397
11638
|
case 14:
|
|
11398
11639
|
c = h(c, L([0, e2.charCodeAt(u + 13)], 40));
|
|
11640
|
+
// fallthrough
|
|
11399
11641
|
case 13:
|
|
11400
11642
|
c = h(c, L([0, e2.charCodeAt(u + 12)], 32));
|
|
11643
|
+
// fallthrough
|
|
11401
11644
|
case 12:
|
|
11402
11645
|
c = h(c, L([0, e2.charCodeAt(u + 11)], 24));
|
|
11646
|
+
// fallthrough
|
|
11403
11647
|
case 11:
|
|
11404
11648
|
c = h(c, L([0, e2.charCodeAt(u + 10)], 16));
|
|
11649
|
+
// fallthrough
|
|
11405
11650
|
case 10:
|
|
11406
11651
|
c = h(c, L([0, e2.charCodeAt(u + 9)], 8));
|
|
11652
|
+
// fallthrough
|
|
11407
11653
|
case 9:
|
|
11408
11654
|
c = h(c, [0, e2.charCodeAt(u + 8)]), c = C(c, s), c = A2(c, 33), c = C(c, l), r2 = h(r2, c);
|
|
11655
|
+
// fallthrough
|
|
11409
11656
|
case 8:
|
|
11410
11657
|
o2 = h(o2, L([0, e2.charCodeAt(u + 7)], 56));
|
|
11658
|
+
// fallthrough
|
|
11411
11659
|
case 7:
|
|
11412
11660
|
o2 = h(o2, L([0, e2.charCodeAt(u + 6)], 48));
|
|
11661
|
+
// fallthrough
|
|
11413
11662
|
case 6:
|
|
11414
11663
|
o2 = h(o2, L([0, e2.charCodeAt(u + 5)], 40));
|
|
11664
|
+
// fallthrough
|
|
11415
11665
|
case 5:
|
|
11416
11666
|
o2 = h(o2, L([0, e2.charCodeAt(u + 4)], 32));
|
|
11667
|
+
// fallthrough
|
|
11417
11668
|
case 4:
|
|
11418
11669
|
o2 = h(o2, L([0, e2.charCodeAt(u + 3)], 24));
|
|
11670
|
+
// fallthrough
|
|
11419
11671
|
case 3:
|
|
11420
11672
|
o2 = h(o2, L([0, e2.charCodeAt(u + 2)], 16));
|
|
11673
|
+
// fallthrough
|
|
11421
11674
|
case 2:
|
|
11422
11675
|
o2 = h(o2, L([0, e2.charCodeAt(u + 1)], 8));
|
|
11676
|
+
// fallthrough
|
|
11423
11677
|
case 1:
|
|
11424
11678
|
o2 = h(o2, [0, e2.charCodeAt(u)]), o2 = C(o2, l), o2 = A2(o2, 31), o2 = C(o2, s), i = h(i, o2);
|
|
11425
11679
|
}
|
|
@@ -11715,6 +11969,9 @@ function Pe(e2) {
|
|
|
11715
11969
|
case "running":
|
|
11716
11970
|
f = Date.now(), s && d2();
|
|
11717
11971
|
break;
|
|
11972
|
+
// Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where
|
|
11973
|
+
// audio context doesn't start at all). A known case is starting an audio context when the browser tab is in
|
|
11974
|
+
// background on iPhone. Retries usually help in this case.
|
|
11718
11975
|
case "suspended":
|
|
11719
11976
|
document.hidden || u++, s && u >= t2 ? l(ee(
|
|
11720
11977
|
"suspended"
|