fds-vue-core 7.1.3 → 7.1.5
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/fds-vue-core.cjs.js +1239 -888
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +1240 -889
- package/dist/fds-vue-core.es.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/FdsTreeView/FdsTreeView.vue +26 -30
- package/src/components/FdsTreeView/TreeNode.vue +19 -10
- package/src/components/FdsTreeView/useTreeState.ts +137 -70
- package/src/components/FdsWeekCalendar/FdsWeekCalendar.vue +12 -12
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -1738,7 +1738,7 @@ const _global = (() => {
|
|
|
1738
1738
|
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
1739
1739
|
})();
|
|
1740
1740
|
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
1741
|
-
function merge() {
|
|
1741
|
+
function merge(...objs) {
|
|
1742
1742
|
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
1743
1743
|
const result = {};
|
|
1744
1744
|
const assignValue = (val, key) => {
|
|
@@ -1746,8 +1746,9 @@ function merge() {
|
|
|
1746
1746
|
return;
|
|
1747
1747
|
}
|
|
1748
1748
|
const targetKey = caseless && findKey$1(result, key) || key;
|
|
1749
|
-
|
|
1750
|
-
|
|
1749
|
+
const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
|
|
1750
|
+
if (isPlainObject(existing) && isPlainObject(val)) {
|
|
1751
|
+
result[targetKey] = merge(existing, val);
|
|
1751
1752
|
} else if (isPlainObject(val)) {
|
|
1752
1753
|
result[targetKey] = merge({}, val);
|
|
1753
1754
|
} else if (isArray(val)) {
|
|
@@ -1756,8 +1757,8 @@ function merge() {
|
|
|
1756
1757
|
result[targetKey] = val;
|
|
1757
1758
|
}
|
|
1758
1759
|
};
|
|
1759
|
-
for (let i = 0, l =
|
|
1760
|
-
|
|
1760
|
+
for (let i = 0, l = objs.length; i < l; i++) {
|
|
1761
|
+
objs[i] && forEach(objs[i], assignValue);
|
|
1761
1762
|
}
|
|
1762
1763
|
return result;
|
|
1763
1764
|
}
|
|
@@ -1767,6 +1768,9 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
1767
1768
|
(val, key) => {
|
|
1768
1769
|
if (thisArg && isFunction$1(val)) {
|
|
1769
1770
|
Object.defineProperty(a, key, {
|
|
1771
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
1772
|
+
// hijack defineProperty's accessor-vs-data resolution.
|
|
1773
|
+
__proto__: null,
|
|
1770
1774
|
value: bind(val, thisArg),
|
|
1771
1775
|
writable: true,
|
|
1772
1776
|
enumerable: true,
|
|
@@ -1774,6 +1778,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
1774
1778
|
});
|
|
1775
1779
|
} else {
|
|
1776
1780
|
Object.defineProperty(a, key, {
|
|
1781
|
+
__proto__: null,
|
|
1777
1782
|
value: val,
|
|
1778
1783
|
writable: true,
|
|
1779
1784
|
enumerable: true,
|
|
@@ -1794,12 +1799,14 @@ const stripBOM = (content) => {
|
|
|
1794
1799
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
1795
1800
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
1796
1801
|
Object.defineProperty(constructor.prototype, "constructor", {
|
|
1802
|
+
__proto__: null,
|
|
1797
1803
|
value: constructor,
|
|
1798
1804
|
writable: true,
|
|
1799
1805
|
enumerable: false,
|
|
1800
1806
|
configurable: true
|
|
1801
1807
|
});
|
|
1802
1808
|
Object.defineProperty(constructor, "super", {
|
|
1809
|
+
__proto__: null,
|
|
1803
1810
|
value: superConstructor.prototype
|
|
1804
1811
|
});
|
|
1805
1812
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -1888,7 +1895,7 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
1888
1895
|
};
|
|
1889
1896
|
const freezeMethods = (obj) => {
|
|
1890
1897
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
1891
|
-
if (isFunction$1(obj) && ["arguments", "caller", "callee"].
|
|
1898
|
+
if (isFunction$1(obj) && ["arguments", "caller", "callee"].includes(name)) {
|
|
1892
1899
|
return false;
|
|
1893
1900
|
}
|
|
1894
1901
|
const value = obj[name];
|
|
@@ -2034,833 +2041,895 @@ const utils$1 = {
|
|
|
2034
2041
|
asap,
|
|
2035
2042
|
isIterable
|
|
2036
2043
|
};
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
2045
|
+
"age",
|
|
2046
|
+
"authorization",
|
|
2047
|
+
"content-length",
|
|
2048
|
+
"content-type",
|
|
2049
|
+
"etag",
|
|
2050
|
+
"expires",
|
|
2051
|
+
"from",
|
|
2052
|
+
"host",
|
|
2053
|
+
"if-modified-since",
|
|
2054
|
+
"if-unmodified-since",
|
|
2055
|
+
"last-modified",
|
|
2056
|
+
"location",
|
|
2057
|
+
"max-forwards",
|
|
2058
|
+
"proxy-authorization",
|
|
2059
|
+
"referer",
|
|
2060
|
+
"retry-after",
|
|
2061
|
+
"user-agent"
|
|
2062
|
+
]);
|
|
2063
|
+
const parseHeaders = (rawHeaders) => {
|
|
2064
|
+
const parsed = {};
|
|
2065
|
+
let key;
|
|
2066
|
+
let val;
|
|
2067
|
+
let i;
|
|
2068
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
2069
|
+
i = line.indexOf(":");
|
|
2070
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
2071
|
+
val = line.substring(i + 1).trim();
|
|
2072
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
2073
|
+
return;
|
|
2044
2074
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
* @param {Object} [config] The config.
|
|
2054
|
-
* @param {Object} [request] The request.
|
|
2055
|
-
* @param {Object} [response] The response.
|
|
2056
|
-
*
|
|
2057
|
-
* @returns {Error} The created error.
|
|
2058
|
-
*/
|
|
2059
|
-
constructor(message2, code, config, request, response) {
|
|
2060
|
-
super(message2);
|
|
2061
|
-
Object.defineProperty(this, "message", {
|
|
2062
|
-
value: message2,
|
|
2063
|
-
enumerable: true,
|
|
2064
|
-
writable: true,
|
|
2065
|
-
configurable: true
|
|
2066
|
-
});
|
|
2067
|
-
this.name = "AxiosError";
|
|
2068
|
-
this.isAxiosError = true;
|
|
2069
|
-
code && (this.code = code);
|
|
2070
|
-
config && (this.config = config);
|
|
2071
|
-
request && (this.request = request);
|
|
2072
|
-
if (response) {
|
|
2073
|
-
this.response = response;
|
|
2074
|
-
this.status = response.status;
|
|
2075
|
+
if (key === "set-cookie") {
|
|
2076
|
+
if (parsed[key]) {
|
|
2077
|
+
parsed[key].push(val);
|
|
2078
|
+
} else {
|
|
2079
|
+
parsed[key] = [val];
|
|
2080
|
+
}
|
|
2081
|
+
} else {
|
|
2082
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2075
2083
|
}
|
|
2084
|
+
});
|
|
2085
|
+
return parsed;
|
|
2086
|
+
};
|
|
2087
|
+
const $internals = /* @__PURE__ */ Symbol("internals");
|
|
2088
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
2089
|
+
function trimSPorHTAB(str) {
|
|
2090
|
+
let start = 0;
|
|
2091
|
+
let end = str.length;
|
|
2092
|
+
while (start < end) {
|
|
2093
|
+
const code = str.charCodeAt(start);
|
|
2094
|
+
if (code !== 9 && code !== 32) {
|
|
2095
|
+
break;
|
|
2096
|
+
}
|
|
2097
|
+
start += 1;
|
|
2076
2098
|
}
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
description: this.description,
|
|
2084
|
-
number: this.number,
|
|
2085
|
-
// Mozilla
|
|
2086
|
-
fileName: this.fileName,
|
|
2087
|
-
lineNumber: this.lineNumber,
|
|
2088
|
-
columnNumber: this.columnNumber,
|
|
2089
|
-
stack: this.stack,
|
|
2090
|
-
// Axios
|
|
2091
|
-
config: utils$1.toJSONObject(this.config),
|
|
2092
|
-
code: this.code,
|
|
2093
|
-
status: this.status
|
|
2094
|
-
};
|
|
2099
|
+
while (end > start) {
|
|
2100
|
+
const code = str.charCodeAt(end - 1);
|
|
2101
|
+
if (code !== 9 && code !== 32) {
|
|
2102
|
+
break;
|
|
2103
|
+
}
|
|
2104
|
+
end -= 1;
|
|
2095
2105
|
}
|
|
2096
|
-
|
|
2097
|
-
AxiosError$1.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
2098
|
-
AxiosError$1.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
2099
|
-
AxiosError$1.ECONNABORTED = "ECONNABORTED";
|
|
2100
|
-
AxiosError$1.ETIMEDOUT = "ETIMEDOUT";
|
|
2101
|
-
AxiosError$1.ERR_NETWORK = "ERR_NETWORK";
|
|
2102
|
-
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
2103
|
-
AxiosError$1.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
2104
|
-
AxiosError$1.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
2105
|
-
AxiosError$1.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
2106
|
-
AxiosError$1.ERR_CANCELED = "ERR_CANCELED";
|
|
2107
|
-
AxiosError$1.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
2108
|
-
AxiosError$1.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
2109
|
-
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
2110
|
-
const httpAdapter = null;
|
|
2111
|
-
function isVisitable(thing) {
|
|
2112
|
-
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
2106
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
2113
2107
|
}
|
|
2114
|
-
function
|
|
2115
|
-
return
|
|
2108
|
+
function normalizeHeader(header) {
|
|
2109
|
+
return header && String(header).trim().toLowerCase();
|
|
2116
2110
|
}
|
|
2117
|
-
function
|
|
2118
|
-
|
|
2119
|
-
return path.concat(key).map(function each(token, i) {
|
|
2120
|
-
token = removeBrackets(token);
|
|
2121
|
-
return !dots && i ? "[" + token + "]" : token;
|
|
2122
|
-
}).join(dots ? "." : "");
|
|
2111
|
+
function sanitizeHeaderValue(str) {
|
|
2112
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
|
|
2123
2113
|
}
|
|
2124
|
-
function
|
|
2125
|
-
|
|
2114
|
+
function normalizeValue(value) {
|
|
2115
|
+
if (value === false || value == null) {
|
|
2116
|
+
return value;
|
|
2117
|
+
}
|
|
2118
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
2126
2119
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2120
|
+
function parseTokens(str) {
|
|
2121
|
+
const tokens = /* @__PURE__ */ Object.create(null);
|
|
2122
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
2123
|
+
let match2;
|
|
2124
|
+
while (match2 = tokensRE.exec(str)) {
|
|
2125
|
+
tokens[match2[1]] = match2[2];
|
|
2133
2126
|
}
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
indexes: false
|
|
2141
|
-
},
|
|
2142
|
-
false,
|
|
2143
|
-
function defined(option, source) {
|
|
2144
|
-
return !utils$1.isUndefined(source[option]);
|
|
2145
|
-
}
|
|
2146
|
-
);
|
|
2147
|
-
const metaTokens = options.metaTokens;
|
|
2148
|
-
const visitor = options.visitor || defaultVisitor;
|
|
2149
|
-
const dots = options.dots;
|
|
2150
|
-
const indexes = options.indexes;
|
|
2151
|
-
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
2152
|
-
const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
|
|
2153
|
-
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
2154
|
-
if (!utils$1.isFunction(visitor)) {
|
|
2155
|
-
throw new TypeError("visitor must be a function");
|
|
2127
|
+
return tokens;
|
|
2128
|
+
}
|
|
2129
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
2130
|
+
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
2131
|
+
if (utils$1.isFunction(filter2)) {
|
|
2132
|
+
return filter2.call(this, value, header);
|
|
2156
2133
|
}
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2134
|
+
if (isHeaderNameFilter) {
|
|
2135
|
+
value = header;
|
|
2136
|
+
}
|
|
2137
|
+
if (!utils$1.isString(value)) return;
|
|
2138
|
+
if (utils$1.isString(filter2)) {
|
|
2139
|
+
return value.indexOf(filter2) !== -1;
|
|
2140
|
+
}
|
|
2141
|
+
if (utils$1.isRegExp(filter2)) {
|
|
2142
|
+
return filter2.test(value);
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
function formatHeader(header) {
|
|
2146
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
2147
|
+
return char.toUpperCase() + str;
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
function buildAccessors(obj, header) {
|
|
2151
|
+
const accessorName = utils$1.toCamelCase(" " + header);
|
|
2152
|
+
["get", "set", "has"].forEach((methodName) => {
|
|
2153
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
2154
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
2155
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
2156
|
+
__proto__: null,
|
|
2157
|
+
value: function(arg1, arg2, arg3) {
|
|
2158
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
2159
|
+
},
|
|
2160
|
+
configurable: true
|
|
2161
|
+
});
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
let AxiosHeaders$1 = class AxiosHeaders {
|
|
2165
|
+
constructor(headers) {
|
|
2166
|
+
headers && this.set(headers);
|
|
2167
|
+
}
|
|
2168
|
+
set(header, valueOrRewrite, rewrite) {
|
|
2169
|
+
const self2 = this;
|
|
2170
|
+
function setHeader(_value, _header, _rewrite) {
|
|
2171
|
+
const lHeader = normalizeHeader(_header);
|
|
2172
|
+
if (!lHeader) {
|
|
2173
|
+
throw new Error("header name must be a non-empty string");
|
|
2174
|
+
}
|
|
2175
|
+
const key = utils$1.findKey(self2, lHeader);
|
|
2176
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
2177
|
+
self2[key || _header] = normalizeValue(_value);
|
|
2178
|
+
}
|
|
2167
2179
|
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2180
|
+
const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
2181
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
2182
|
+
setHeaders(header, valueOrRewrite);
|
|
2183
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2184
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
2185
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
2186
|
+
let obj = {}, dest, key;
|
|
2187
|
+
for (const entry of header) {
|
|
2188
|
+
if (!utils$1.isArray(entry)) {
|
|
2189
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
2190
|
+
}
|
|
2191
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
2192
|
+
}
|
|
2193
|
+
setHeaders(obj, valueOrRewrite);
|
|
2194
|
+
} else {
|
|
2195
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2170
2196
|
}
|
|
2171
|
-
return
|
|
2197
|
+
return this;
|
|
2172
2198
|
}
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
if (
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
return false;
|
|
2199
|
+
get(header, parser) {
|
|
2200
|
+
header = normalizeHeader(header);
|
|
2201
|
+
if (header) {
|
|
2202
|
+
const key = utils$1.findKey(this, header);
|
|
2203
|
+
if (key) {
|
|
2204
|
+
const value = this[key];
|
|
2205
|
+
if (!parser) {
|
|
2206
|
+
return value;
|
|
2207
|
+
}
|
|
2208
|
+
if (parser === true) {
|
|
2209
|
+
return parseTokens(value);
|
|
2210
|
+
}
|
|
2211
|
+
if (utils$1.isFunction(parser)) {
|
|
2212
|
+
return parser.call(this, value, key);
|
|
2213
|
+
}
|
|
2214
|
+
if (utils$1.isRegExp(parser)) {
|
|
2215
|
+
return parser.exec(value);
|
|
2216
|
+
}
|
|
2217
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
2193
2218
|
}
|
|
2194
2219
|
}
|
|
2195
|
-
|
|
2196
|
-
|
|
2220
|
+
}
|
|
2221
|
+
has(header, matcher) {
|
|
2222
|
+
header = normalizeHeader(header);
|
|
2223
|
+
if (header) {
|
|
2224
|
+
const key = utils$1.findKey(this, header);
|
|
2225
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
2197
2226
|
}
|
|
2198
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
2199
2227
|
return false;
|
|
2200
2228
|
}
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
);
|
|
2229
|
+
delete(header, matcher) {
|
|
2230
|
+
const self2 = this;
|
|
2231
|
+
let deleted = false;
|
|
2232
|
+
function deleteHeader(_header) {
|
|
2233
|
+
_header = normalizeHeader(_header);
|
|
2234
|
+
if (_header) {
|
|
2235
|
+
const key = utils$1.findKey(self2, _header);
|
|
2236
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
2237
|
+
delete self2[key];
|
|
2238
|
+
deleted = true;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2214
2241
|
}
|
|
2215
|
-
if (
|
|
2216
|
-
|
|
2242
|
+
if (utils$1.isArray(header)) {
|
|
2243
|
+
header.forEach(deleteHeader);
|
|
2244
|
+
} else {
|
|
2245
|
+
deleteHeader(header);
|
|
2217
2246
|
}
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2247
|
+
return deleted;
|
|
2248
|
+
}
|
|
2249
|
+
clear(matcher) {
|
|
2250
|
+
const keys = Object.keys(this);
|
|
2251
|
+
let i = keys.length;
|
|
2252
|
+
let deleted = false;
|
|
2253
|
+
while (i--) {
|
|
2254
|
+
const key = keys[i];
|
|
2255
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
2256
|
+
delete this[key];
|
|
2257
|
+
deleted = true;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
return deleted;
|
|
2261
|
+
}
|
|
2262
|
+
normalize(format2) {
|
|
2263
|
+
const self2 = this;
|
|
2264
|
+
const headers = {};
|
|
2265
|
+
utils$1.forEach(this, (value, header) => {
|
|
2266
|
+
const key = utils$1.findKey(headers, header);
|
|
2267
|
+
if (key) {
|
|
2268
|
+
self2[key] = normalizeValue(value);
|
|
2269
|
+
delete self2[header];
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
const normalized = format2 ? formatHeader(header) : String(header).trim();
|
|
2273
|
+
if (normalized !== header) {
|
|
2274
|
+
delete self2[header];
|
|
2223
2275
|
}
|
|
2276
|
+
self2[normalized] = normalizeValue(value);
|
|
2277
|
+
headers[normalized] = true;
|
|
2224
2278
|
});
|
|
2225
|
-
|
|
2279
|
+
return this;
|
|
2226
2280
|
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2281
|
+
concat(...targets) {
|
|
2282
|
+
return this.constructor.concat(this, ...targets);
|
|
2229
2283
|
}
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
"'": "%27",
|
|
2237
|
-
"(": "%28",
|
|
2238
|
-
")": "%29",
|
|
2239
|
-
"~": "%7E",
|
|
2240
|
-
"%20": "+"
|
|
2241
|
-
};
|
|
2242
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match2) {
|
|
2243
|
-
return charMap[match2];
|
|
2244
|
-
});
|
|
2245
|
-
}
|
|
2246
|
-
function AxiosURLSearchParams(params, options) {
|
|
2247
|
-
this._pairs = [];
|
|
2248
|
-
params && toFormData$1(params, this, options);
|
|
2249
|
-
}
|
|
2250
|
-
const prototype = AxiosURLSearchParams.prototype;
|
|
2251
|
-
prototype.append = function append(name, value) {
|
|
2252
|
-
this._pairs.push([name, value]);
|
|
2253
|
-
};
|
|
2254
|
-
prototype.toString = function toString2(encoder) {
|
|
2255
|
-
const _encode = encoder ? function(value) {
|
|
2256
|
-
return encoder.call(this, value, encode$1);
|
|
2257
|
-
} : encode$1;
|
|
2258
|
-
return this._pairs.map(function each(pair) {
|
|
2259
|
-
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
2260
|
-
}, "").join("&");
|
|
2261
|
-
};
|
|
2262
|
-
function encode(val) {
|
|
2263
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
2264
|
-
}
|
|
2265
|
-
function buildURL(url, params, options) {
|
|
2266
|
-
if (!params) {
|
|
2267
|
-
return url;
|
|
2284
|
+
toJSON(asStrings) {
|
|
2285
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
2286
|
+
utils$1.forEach(this, (value, header) => {
|
|
2287
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
2288
|
+
});
|
|
2289
|
+
return obj;
|
|
2268
2290
|
}
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
serialize: options
|
|
2272
|
-
} : options;
|
|
2273
|
-
const serializeFn = _options && _options.serialize;
|
|
2274
|
-
let serializedParams;
|
|
2275
|
-
if (serializeFn) {
|
|
2276
|
-
serializedParams = serializeFn(params, _options);
|
|
2277
|
-
} else {
|
|
2278
|
-
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
2291
|
+
[Symbol.iterator]() {
|
|
2292
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
2279
2293
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
if (hashmarkIndex !== -1) {
|
|
2283
|
-
url = url.slice(0, hashmarkIndex);
|
|
2284
|
-
}
|
|
2285
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2294
|
+
toString() {
|
|
2295
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2286
2296
|
}
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
class InterceptorManager {
|
|
2290
|
-
constructor() {
|
|
2291
|
-
this.handlers = [];
|
|
2297
|
+
getSetCookie() {
|
|
2298
|
+
return this.get("set-cookie") || [];
|
|
2292
2299
|
}
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
*
|
|
2296
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
2297
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
2298
|
-
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
2299
|
-
*
|
|
2300
|
-
* @return {Number} An ID used to remove interceptor later
|
|
2301
|
-
*/
|
|
2302
|
-
use(fulfilled, rejected, options) {
|
|
2303
|
-
this.handlers.push({
|
|
2304
|
-
fulfilled,
|
|
2305
|
-
rejected,
|
|
2306
|
-
synchronous: options ? options.synchronous : false,
|
|
2307
|
-
runWhen: options ? options.runWhen : null
|
|
2308
|
-
});
|
|
2309
|
-
return this.handlers.length - 1;
|
|
2300
|
+
get [Symbol.toStringTag]() {
|
|
2301
|
+
return "AxiosHeaders";
|
|
2310
2302
|
}
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
*
|
|
2314
|
-
* @param {Number} id The ID that was returned by `use`
|
|
2315
|
-
*
|
|
2316
|
-
* @returns {void}
|
|
2317
|
-
*/
|
|
2318
|
-
eject(id) {
|
|
2319
|
-
if (this.handlers[id]) {
|
|
2320
|
-
this.handlers[id] = null;
|
|
2321
|
-
}
|
|
2303
|
+
static from(thing) {
|
|
2304
|
+
return thing instanceof this ? thing : new this(thing);
|
|
2322
2305
|
}
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
*/
|
|
2328
|
-
clear() {
|
|
2329
|
-
if (this.handlers) {
|
|
2330
|
-
this.handlers = [];
|
|
2331
|
-
}
|
|
2306
|
+
static concat(first, ...targets) {
|
|
2307
|
+
const computed = new this(first);
|
|
2308
|
+
targets.forEach((target) => computed.set(target));
|
|
2309
|
+
return computed;
|
|
2332
2310
|
}
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
2345
|
-
if (h !== null) {
|
|
2346
|
-
fn(h);
|
|
2311
|
+
static accessor(header) {
|
|
2312
|
+
const internals = this[$internals] = this[$internals] = {
|
|
2313
|
+
accessors: {}
|
|
2314
|
+
};
|
|
2315
|
+
const accessors = internals.accessors;
|
|
2316
|
+
const prototype2 = this.prototype;
|
|
2317
|
+
function defineAccessor(_header) {
|
|
2318
|
+
const lHeader = normalizeHeader(_header);
|
|
2319
|
+
if (!accessors[lHeader]) {
|
|
2320
|
+
buildAccessors(prototype2, _header);
|
|
2321
|
+
accessors[lHeader] = true;
|
|
2347
2322
|
}
|
|
2348
|
-
}
|
|
2323
|
+
}
|
|
2324
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
2325
|
+
return this;
|
|
2349
2326
|
}
|
|
2350
|
-
}
|
|
2351
|
-
const transitionalDefaults = {
|
|
2352
|
-
silentJSONParsing: true,
|
|
2353
|
-
forcedJSONParsing: true,
|
|
2354
|
-
clarifyTimeoutError: false,
|
|
2355
|
-
legacyInterceptorReqResOrdering: true
|
|
2356
|
-
};
|
|
2357
|
-
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
2358
|
-
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
2359
|
-
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
2360
|
-
const platform$1 = {
|
|
2361
|
-
isBrowser: true,
|
|
2362
|
-
classes: {
|
|
2363
|
-
URLSearchParams: URLSearchParams$1,
|
|
2364
|
-
FormData: FormData$1,
|
|
2365
|
-
Blob: Blob$1
|
|
2366
|
-
},
|
|
2367
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
2368
|
-
};
|
|
2369
|
-
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2370
|
-
const _navigator = typeof navigator === "object" && navigator || void 0;
|
|
2371
|
-
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
2372
|
-
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
2373
|
-
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
2374
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
2375
|
-
})();
|
|
2376
|
-
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
2377
|
-
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2378
|
-
__proto__: null,
|
|
2379
|
-
hasBrowserEnv,
|
|
2380
|
-
hasStandardBrowserEnv,
|
|
2381
|
-
hasStandardBrowserWebWorkerEnv,
|
|
2382
|
-
navigator: _navigator,
|
|
2383
|
-
origin
|
|
2384
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2385
|
-
const platform = {
|
|
2386
|
-
...utils,
|
|
2387
|
-
...platform$1
|
|
2388
2327
|
};
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
return match2[0] === "[]" ? "" : match2[1] || match2[0];
|
|
2404
|
-
});
|
|
2405
|
-
}
|
|
2406
|
-
function arrayToObject(arr) {
|
|
2407
|
-
const obj = {};
|
|
2408
|
-
const keys = Object.keys(arr);
|
|
2409
|
-
let i;
|
|
2410
|
-
const len = keys.length;
|
|
2411
|
-
let key;
|
|
2412
|
-
for (i = 0; i < len; i++) {
|
|
2413
|
-
key = keys[i];
|
|
2414
|
-
obj[key] = arr[key];
|
|
2415
|
-
}
|
|
2416
|
-
return obj;
|
|
2417
|
-
}
|
|
2418
|
-
function formDataToJSON(formData) {
|
|
2419
|
-
function buildPath(path, value, target, index) {
|
|
2420
|
-
let name = path[index++];
|
|
2421
|
-
if (name === "__proto__") return true;
|
|
2422
|
-
const isNumericKey = Number.isFinite(+name);
|
|
2423
|
-
const isLast = index >= path.length;
|
|
2424
|
-
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
2425
|
-
if (isLast) {
|
|
2426
|
-
if (utils$1.hasOwnProp(target, name)) {
|
|
2427
|
-
target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
|
|
2428
|
-
} else {
|
|
2429
|
-
target[name] = value;
|
|
2430
|
-
}
|
|
2431
|
-
return !isNumericKey;
|
|
2432
|
-
}
|
|
2433
|
-
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
2434
|
-
target[name] = [];
|
|
2435
|
-
}
|
|
2436
|
-
const result = buildPath(path, value, target[name], index);
|
|
2437
|
-
if (result && utils$1.isArray(target[name])) {
|
|
2438
|
-
target[name] = arrayToObject(target[name]);
|
|
2328
|
+
AxiosHeaders$1.accessor([
|
|
2329
|
+
"Content-Type",
|
|
2330
|
+
"Content-Length",
|
|
2331
|
+
"Accept",
|
|
2332
|
+
"Accept-Encoding",
|
|
2333
|
+
"User-Agent",
|
|
2334
|
+
"Authorization"
|
|
2335
|
+
]);
|
|
2336
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
2337
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
2338
|
+
return {
|
|
2339
|
+
get: () => value,
|
|
2340
|
+
set(headerValue) {
|
|
2341
|
+
this[mapped] = headerValue;
|
|
2439
2342
|
}
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
return obj;
|
|
2343
|
+
};
|
|
2344
|
+
});
|
|
2345
|
+
utils$1.freezeMethods(AxiosHeaders$1);
|
|
2346
|
+
const REDACTED = "[REDACTED ****]";
|
|
2347
|
+
function hasOwnOrPrototypeToJSON(source) {
|
|
2348
|
+
if (utils$1.hasOwnProp(source, "toJSON")) {
|
|
2349
|
+
return true;
|
|
2448
2350
|
}
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
if (utils$1.isString(rawValue)) {
|
|
2454
|
-
try {
|
|
2455
|
-
(parser || JSON.parse)(rawValue);
|
|
2456
|
-
return utils$1.trim(rawValue);
|
|
2457
|
-
} catch (e) {
|
|
2458
|
-
if (e.name !== "SyntaxError") {
|
|
2459
|
-
throw e;
|
|
2460
|
-
}
|
|
2351
|
+
let prototype2 = Object.getPrototypeOf(source);
|
|
2352
|
+
while (prototype2 && prototype2 !== Object.prototype) {
|
|
2353
|
+
if (utils$1.hasOwnProp(prototype2, "toJSON")) {
|
|
2354
|
+
return true;
|
|
2461
2355
|
}
|
|
2356
|
+
prototype2 = Object.getPrototypeOf(prototype2);
|
|
2462
2357
|
}
|
|
2463
|
-
return
|
|
2358
|
+
return false;
|
|
2464
2359
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
if (utils$1.isArrayBufferView(data)) {
|
|
2484
|
-
return data.buffer;
|
|
2485
|
-
}
|
|
2486
|
-
if (utils$1.isURLSearchParams(data)) {
|
|
2487
|
-
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
2488
|
-
return data.toString();
|
|
2489
|
-
}
|
|
2490
|
-
let isFileList2;
|
|
2491
|
-
if (isObjectPayload) {
|
|
2492
|
-
const formSerializer = own(this, "formSerializer");
|
|
2493
|
-
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
2494
|
-
return toURLEncodedForm(data, formSerializer).toString();
|
|
2495
|
-
}
|
|
2496
|
-
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
2497
|
-
const env = own(this, "env");
|
|
2498
|
-
const _FormData = env && env.FormData;
|
|
2499
|
-
return toFormData$1(
|
|
2500
|
-
isFileList2 ? { "files[]": data } : data,
|
|
2501
|
-
_FormData && new _FormData(),
|
|
2502
|
-
formSerializer
|
|
2503
|
-
);
|
|
2360
|
+
function redactConfig(config, redactKeys) {
|
|
2361
|
+
const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
|
|
2362
|
+
const seen = [];
|
|
2363
|
+
const visit = (source) => {
|
|
2364
|
+
if (source === null || typeof source !== "object") return source;
|
|
2365
|
+
if (utils$1.isBuffer(source)) return source;
|
|
2366
|
+
if (seen.indexOf(source) !== -1) return void 0;
|
|
2367
|
+
if (source instanceof AxiosHeaders$1) {
|
|
2368
|
+
source = source.toJSON();
|
|
2369
|
+
}
|
|
2370
|
+
seen.push(source);
|
|
2371
|
+
let result;
|
|
2372
|
+
if (utils$1.isArray(source)) {
|
|
2373
|
+
result = [];
|
|
2374
|
+
source.forEach((v, i) => {
|
|
2375
|
+
const reducedValue = visit(v);
|
|
2376
|
+
if (!utils$1.isUndefined(reducedValue)) {
|
|
2377
|
+
result[i] = reducedValue;
|
|
2504
2378
|
}
|
|
2379
|
+
});
|
|
2380
|
+
} else {
|
|
2381
|
+
if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
|
|
2382
|
+
seen.pop();
|
|
2383
|
+
return source;
|
|
2505
2384
|
}
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
}
|
|
2512
|
-
],
|
|
2513
|
-
transformResponse: [
|
|
2514
|
-
function transformResponse(data) {
|
|
2515
|
-
const transitional2 = own(this, "transitional") || defaults.transitional;
|
|
2516
|
-
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2517
|
-
const responseType = own(this, "responseType");
|
|
2518
|
-
const JSONRequested = responseType === "json";
|
|
2519
|
-
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
2520
|
-
return data;
|
|
2521
|
-
}
|
|
2522
|
-
if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
|
|
2523
|
-
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2524
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
2525
|
-
try {
|
|
2526
|
-
return JSON.parse(data, own(this, "parseReviver"));
|
|
2527
|
-
} catch (e) {
|
|
2528
|
-
if (strictJSONParsing) {
|
|
2529
|
-
if (e.name === "SyntaxError") {
|
|
2530
|
-
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, "response"));
|
|
2531
|
-
}
|
|
2532
|
-
throw e;
|
|
2533
|
-
}
|
|
2385
|
+
result = /* @__PURE__ */ Object.create(null);
|
|
2386
|
+
for (const [key, value] of Object.entries(source)) {
|
|
2387
|
+
const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
|
|
2388
|
+
if (!utils$1.isUndefined(reducedValue)) {
|
|
2389
|
+
result[key] = reducedValue;
|
|
2534
2390
|
}
|
|
2535
2391
|
}
|
|
2536
|
-
return data;
|
|
2537
2392
|
}
|
|
2538
|
-
|
|
2393
|
+
seen.pop();
|
|
2394
|
+
return result;
|
|
2395
|
+
};
|
|
2396
|
+
return visit(config);
|
|
2397
|
+
}
|
|
2398
|
+
let AxiosError$1 = class AxiosError extends Error {
|
|
2399
|
+
static from(error, code, config, request, response, customProps) {
|
|
2400
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
2401
|
+
axiosError.cause = error;
|
|
2402
|
+
axiosError.name = error.name;
|
|
2403
|
+
if (error.status != null && axiosError.status == null) {
|
|
2404
|
+
axiosError.status = error.status;
|
|
2405
|
+
}
|
|
2406
|
+
customProps && Object.assign(axiosError, customProps);
|
|
2407
|
+
return axiosError;
|
|
2408
|
+
}
|
|
2539
2409
|
/**
|
|
2540
|
-
*
|
|
2541
|
-
*
|
|
2410
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
2411
|
+
*
|
|
2412
|
+
* @param {string} message The error message.
|
|
2413
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
2414
|
+
* @param {Object} [config] The config.
|
|
2415
|
+
* @param {Object} [request] The request.
|
|
2416
|
+
* @param {Object} [response] The response.
|
|
2417
|
+
*
|
|
2418
|
+
* @returns {Error} The created error.
|
|
2542
2419
|
*/
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2420
|
+
constructor(message2, code, config, request, response) {
|
|
2421
|
+
super(message2);
|
|
2422
|
+
Object.defineProperty(this, "message", {
|
|
2423
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
2424
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
2425
|
+
__proto__: null,
|
|
2426
|
+
value: message2,
|
|
2427
|
+
enumerable: true,
|
|
2428
|
+
writable: true,
|
|
2429
|
+
configurable: true
|
|
2430
|
+
});
|
|
2431
|
+
this.name = "AxiosError";
|
|
2432
|
+
this.isAxiosError = true;
|
|
2433
|
+
code && (this.code = code);
|
|
2434
|
+
config && (this.config = config);
|
|
2435
|
+
request && (this.request = request);
|
|
2436
|
+
if (response) {
|
|
2437
|
+
this.response = response;
|
|
2438
|
+
this.status = response.status;
|
|
2559
2439
|
}
|
|
2560
2440
|
}
|
|
2441
|
+
toJSON() {
|
|
2442
|
+
const config = this.config;
|
|
2443
|
+
const redactKeys = config && utils$1.hasOwnProp(config, "redact") ? config.redact : void 0;
|
|
2444
|
+
const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config);
|
|
2445
|
+
return {
|
|
2446
|
+
// Standard
|
|
2447
|
+
message: this.message,
|
|
2448
|
+
name: this.name,
|
|
2449
|
+
// Microsoft
|
|
2450
|
+
description: this.description,
|
|
2451
|
+
number: this.number,
|
|
2452
|
+
// Mozilla
|
|
2453
|
+
fileName: this.fileName,
|
|
2454
|
+
lineNumber: this.lineNumber,
|
|
2455
|
+
columnNumber: this.columnNumber,
|
|
2456
|
+
stack: this.stack,
|
|
2457
|
+
// Axios
|
|
2458
|
+
config: serializedConfig,
|
|
2459
|
+
code: this.code,
|
|
2460
|
+
status: this.status
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2561
2463
|
};
|
|
2562
|
-
|
|
2563
|
-
|
|
2464
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
2465
|
+
AxiosError$1.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
2466
|
+
AxiosError$1.ECONNABORTED = "ECONNABORTED";
|
|
2467
|
+
AxiosError$1.ETIMEDOUT = "ETIMEDOUT";
|
|
2468
|
+
AxiosError$1.ECONNREFUSED = "ECONNREFUSED";
|
|
2469
|
+
AxiosError$1.ERR_NETWORK = "ERR_NETWORK";
|
|
2470
|
+
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
2471
|
+
AxiosError$1.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
2472
|
+
AxiosError$1.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
2473
|
+
AxiosError$1.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
2474
|
+
AxiosError$1.ERR_CANCELED = "ERR_CANCELED";
|
|
2475
|
+
AxiosError$1.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
2476
|
+
AxiosError$1.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
2477
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
2478
|
+
const httpAdapter = null;
|
|
2479
|
+
function isVisitable(thing) {
|
|
2480
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
2481
|
+
}
|
|
2482
|
+
function removeBrackets(key) {
|
|
2483
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
2484
|
+
}
|
|
2485
|
+
function renderKey(path, key, dots) {
|
|
2486
|
+
if (!path) return key;
|
|
2487
|
+
return path.concat(key).map(function each(token, i) {
|
|
2488
|
+
token = removeBrackets(token);
|
|
2489
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
2490
|
+
}).join(dots ? "." : "");
|
|
2491
|
+
}
|
|
2492
|
+
function isFlatArray(arr) {
|
|
2493
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
2494
|
+
}
|
|
2495
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
2496
|
+
return /^is[A-Z]/.test(prop);
|
|
2564
2497
|
});
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
const
|
|
2585
|
-
const
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
if (
|
|
2594
|
-
|
|
2498
|
+
function toFormData$1(obj, formData, options) {
|
|
2499
|
+
if (!utils$1.isObject(obj)) {
|
|
2500
|
+
throw new TypeError("target must be an object");
|
|
2501
|
+
}
|
|
2502
|
+
formData = formData || new FormData();
|
|
2503
|
+
options = utils$1.toFlatObject(
|
|
2504
|
+
options,
|
|
2505
|
+
{
|
|
2506
|
+
metaTokens: true,
|
|
2507
|
+
dots: false,
|
|
2508
|
+
indexes: false
|
|
2509
|
+
},
|
|
2510
|
+
false,
|
|
2511
|
+
function defined(option, source) {
|
|
2512
|
+
return !utils$1.isUndefined(source[option]);
|
|
2513
|
+
}
|
|
2514
|
+
);
|
|
2515
|
+
const metaTokens = options.metaTokens;
|
|
2516
|
+
const visitor = options.visitor || defaultVisitor;
|
|
2517
|
+
const dots = options.dots;
|
|
2518
|
+
const indexes = options.indexes;
|
|
2519
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
2520
|
+
const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
|
|
2521
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
2522
|
+
if (!utils$1.isFunction(visitor)) {
|
|
2523
|
+
throw new TypeError("visitor must be a function");
|
|
2524
|
+
}
|
|
2525
|
+
function convertValue(value) {
|
|
2526
|
+
if (value === null) return "";
|
|
2527
|
+
if (utils$1.isDate(value)) {
|
|
2528
|
+
return value.toISOString();
|
|
2595
2529
|
}
|
|
2596
|
-
if (
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2530
|
+
if (utils$1.isBoolean(value)) {
|
|
2531
|
+
return value.toString();
|
|
2532
|
+
}
|
|
2533
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
2534
|
+
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
2535
|
+
}
|
|
2536
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
2537
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
2538
|
+
}
|
|
2539
|
+
return value;
|
|
2540
|
+
}
|
|
2541
|
+
function defaultVisitor(value, key, path) {
|
|
2542
|
+
let arr = value;
|
|
2543
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
2544
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
2545
|
+
return false;
|
|
2546
|
+
}
|
|
2547
|
+
if (value && !path && typeof value === "object") {
|
|
2548
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
2549
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
2550
|
+
value = JSON.stringify(value);
|
|
2551
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
2552
|
+
key = removeBrackets(key);
|
|
2553
|
+
arr.forEach(function each(el, index) {
|
|
2554
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
2555
|
+
// eslint-disable-next-line no-nested-ternary
|
|
2556
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
2557
|
+
convertValue(el)
|
|
2558
|
+
);
|
|
2559
|
+
});
|
|
2560
|
+
return false;
|
|
2601
2561
|
}
|
|
2602
|
-
} else {
|
|
2603
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2604
2562
|
}
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
};
|
|
2608
|
-
const $internals = /* @__PURE__ */ Symbol("internals");
|
|
2609
|
-
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
2610
|
-
function trimSPorHTAB(str) {
|
|
2611
|
-
let start = 0;
|
|
2612
|
-
let end = str.length;
|
|
2613
|
-
while (start < end) {
|
|
2614
|
-
const code = str.charCodeAt(start);
|
|
2615
|
-
if (code !== 9 && code !== 32) {
|
|
2616
|
-
break;
|
|
2563
|
+
if (isVisitable(value)) {
|
|
2564
|
+
return true;
|
|
2617
2565
|
}
|
|
2618
|
-
|
|
2566
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
2567
|
+
return false;
|
|
2619
2568
|
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2569
|
+
const stack = [];
|
|
2570
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
2571
|
+
defaultVisitor,
|
|
2572
|
+
convertValue,
|
|
2573
|
+
isVisitable
|
|
2574
|
+
});
|
|
2575
|
+
function build(value, path, depth = 0) {
|
|
2576
|
+
if (utils$1.isUndefined(value)) return;
|
|
2577
|
+
if (depth > maxDepth) {
|
|
2578
|
+
throw new AxiosError$1(
|
|
2579
|
+
"Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth,
|
|
2580
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
2581
|
+
);
|
|
2624
2582
|
}
|
|
2625
|
-
|
|
2583
|
+
if (stack.indexOf(value) !== -1) {
|
|
2584
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
2585
|
+
}
|
|
2586
|
+
stack.push(value);
|
|
2587
|
+
utils$1.forEach(value, function each(el, key) {
|
|
2588
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
2589
|
+
if (result === true) {
|
|
2590
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
2591
|
+
}
|
|
2592
|
+
});
|
|
2593
|
+
stack.pop();
|
|
2626
2594
|
}
|
|
2627
|
-
|
|
2595
|
+
if (!utils$1.isObject(obj)) {
|
|
2596
|
+
throw new TypeError("data must be an object");
|
|
2597
|
+
}
|
|
2598
|
+
build(obj);
|
|
2599
|
+
return formData;
|
|
2628
2600
|
}
|
|
2629
|
-
function
|
|
2630
|
-
|
|
2601
|
+
function encode$1(str) {
|
|
2602
|
+
const charMap = {
|
|
2603
|
+
"!": "%21",
|
|
2604
|
+
"'": "%27",
|
|
2605
|
+
"(": "%28",
|
|
2606
|
+
")": "%29",
|
|
2607
|
+
"~": "%7E",
|
|
2608
|
+
"%20": "+"
|
|
2609
|
+
};
|
|
2610
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match2) {
|
|
2611
|
+
return charMap[match2];
|
|
2612
|
+
});
|
|
2631
2613
|
}
|
|
2632
|
-
function
|
|
2633
|
-
|
|
2614
|
+
function AxiosURLSearchParams(params, options) {
|
|
2615
|
+
this._pairs = [];
|
|
2616
|
+
params && toFormData$1(params, this, options);
|
|
2634
2617
|
}
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2618
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
2619
|
+
prototype.append = function append(name, value) {
|
|
2620
|
+
this._pairs.push([name, value]);
|
|
2621
|
+
};
|
|
2622
|
+
prototype.toString = function toString2(encoder) {
|
|
2623
|
+
const _encode = encoder ? function(value) {
|
|
2624
|
+
return encoder.call(this, value, encode$1);
|
|
2625
|
+
} : encode$1;
|
|
2626
|
+
return this._pairs.map(function each(pair) {
|
|
2627
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
2628
|
+
}, "").join("&");
|
|
2629
|
+
};
|
|
2630
|
+
function encode(val) {
|
|
2631
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
2640
2632
|
}
|
|
2641
|
-
function
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
let match2;
|
|
2645
|
-
while (match2 = tokensRE.exec(str)) {
|
|
2646
|
-
tokens[match2[1]] = match2[2];
|
|
2633
|
+
function buildURL(url, params, options) {
|
|
2634
|
+
if (!params) {
|
|
2635
|
+
return url;
|
|
2647
2636
|
}
|
|
2648
|
-
|
|
2637
|
+
const _encode = options && options.encode || encode;
|
|
2638
|
+
const _options = utils$1.isFunction(options) ? {
|
|
2639
|
+
serialize: options
|
|
2640
|
+
} : options;
|
|
2641
|
+
const serializeFn = _options && _options.serialize;
|
|
2642
|
+
let serializedParams;
|
|
2643
|
+
if (serializeFn) {
|
|
2644
|
+
serializedParams = serializeFn(params, _options);
|
|
2645
|
+
} else {
|
|
2646
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
2647
|
+
}
|
|
2648
|
+
if (serializedParams) {
|
|
2649
|
+
const hashmarkIndex = url.indexOf("#");
|
|
2650
|
+
if (hashmarkIndex !== -1) {
|
|
2651
|
+
url = url.slice(0, hashmarkIndex);
|
|
2652
|
+
}
|
|
2653
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2654
|
+
}
|
|
2655
|
+
return url;
|
|
2649
2656
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
return filter2.call(this, value, header);
|
|
2657
|
+
class InterceptorManager {
|
|
2658
|
+
constructor() {
|
|
2659
|
+
this.handlers = [];
|
|
2654
2660
|
}
|
|
2655
|
-
|
|
2656
|
-
|
|
2661
|
+
/**
|
|
2662
|
+
* Add a new interceptor to the stack
|
|
2663
|
+
*
|
|
2664
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
2665
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
2666
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
2667
|
+
*
|
|
2668
|
+
* @return {Number} An ID used to remove interceptor later
|
|
2669
|
+
*/
|
|
2670
|
+
use(fulfilled, rejected, options) {
|
|
2671
|
+
this.handlers.push({
|
|
2672
|
+
fulfilled,
|
|
2673
|
+
rejected,
|
|
2674
|
+
synchronous: options ? options.synchronous : false,
|
|
2675
|
+
runWhen: options ? options.runWhen : null
|
|
2676
|
+
});
|
|
2677
|
+
return this.handlers.length - 1;
|
|
2657
2678
|
}
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2679
|
+
/**
|
|
2680
|
+
* Remove an interceptor from the stack
|
|
2681
|
+
*
|
|
2682
|
+
* @param {Number} id The ID that was returned by `use`
|
|
2683
|
+
*
|
|
2684
|
+
* @returns {void}
|
|
2685
|
+
*/
|
|
2686
|
+
eject(id) {
|
|
2687
|
+
if (this.handlers[id]) {
|
|
2688
|
+
this.handlers[id] = null;
|
|
2689
|
+
}
|
|
2661
2690
|
}
|
|
2662
|
-
|
|
2663
|
-
|
|
2691
|
+
/**
|
|
2692
|
+
* Clear all interceptors from the stack
|
|
2693
|
+
*
|
|
2694
|
+
* @returns {void}
|
|
2695
|
+
*/
|
|
2696
|
+
clear() {
|
|
2697
|
+
if (this.handlers) {
|
|
2698
|
+
this.handlers = [];
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
/**
|
|
2702
|
+
* Iterate over all the registered interceptors
|
|
2703
|
+
*
|
|
2704
|
+
* This method is particularly useful for skipping over any
|
|
2705
|
+
* interceptors that may have become `null` calling `eject`.
|
|
2706
|
+
*
|
|
2707
|
+
* @param {Function} fn The function to call for each interceptor
|
|
2708
|
+
*
|
|
2709
|
+
* @returns {void}
|
|
2710
|
+
*/
|
|
2711
|
+
forEach(fn) {
|
|
2712
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
2713
|
+
if (h !== null) {
|
|
2714
|
+
fn(h);
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2664
2717
|
}
|
|
2665
2718
|
}
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2719
|
+
const transitionalDefaults = {
|
|
2720
|
+
silentJSONParsing: true,
|
|
2721
|
+
forcedJSONParsing: true,
|
|
2722
|
+
clarifyTimeoutError: false,
|
|
2723
|
+
legacyInterceptorReqResOrdering: true
|
|
2724
|
+
};
|
|
2725
|
+
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
2726
|
+
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
2727
|
+
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
2728
|
+
const platform$1 = {
|
|
2729
|
+
isBrowser: true,
|
|
2730
|
+
classes: {
|
|
2731
|
+
URLSearchParams: URLSearchParams$1,
|
|
2732
|
+
FormData: FormData$1,
|
|
2733
|
+
Blob: Blob$1
|
|
2734
|
+
},
|
|
2735
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
2736
|
+
};
|
|
2737
|
+
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2738
|
+
const _navigator = typeof navigator === "object" && navigator || void 0;
|
|
2739
|
+
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
2740
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
2741
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
2742
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
2743
|
+
})();
|
|
2744
|
+
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
2745
|
+
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2746
|
+
__proto__: null,
|
|
2747
|
+
hasBrowserEnv,
|
|
2748
|
+
hasStandardBrowserEnv,
|
|
2749
|
+
hasStandardBrowserWebWorkerEnv,
|
|
2750
|
+
navigator: _navigator,
|
|
2751
|
+
origin
|
|
2752
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2753
|
+
const platform = {
|
|
2754
|
+
...utils,
|
|
2755
|
+
...platform$1
|
|
2756
|
+
};
|
|
2757
|
+
function toURLEncodedForm(data, options) {
|
|
2758
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
2759
|
+
visitor: function(value, key, path, helpers) {
|
|
2760
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
2761
|
+
this.append(key, value.toString("base64"));
|
|
2762
|
+
return false;
|
|
2763
|
+
}
|
|
2764
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
2765
|
+
},
|
|
2766
|
+
...options
|
|
2669
2767
|
});
|
|
2670
2768
|
}
|
|
2671
|
-
function
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
Object.defineProperty(obj, methodName + accessorName, {
|
|
2675
|
-
value: function(arg1, arg2, arg3) {
|
|
2676
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
2677
|
-
},
|
|
2678
|
-
configurable: true
|
|
2679
|
-
});
|
|
2769
|
+
function parsePropPath(name) {
|
|
2770
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => {
|
|
2771
|
+
return match2[0] === "[]" ? "" : match2[1] || match2[0];
|
|
2680
2772
|
});
|
|
2681
2773
|
}
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2774
|
+
function arrayToObject(arr) {
|
|
2775
|
+
const obj = {};
|
|
2776
|
+
const keys = Object.keys(arr);
|
|
2777
|
+
let i;
|
|
2778
|
+
const len = keys.length;
|
|
2779
|
+
let key;
|
|
2780
|
+
for (i = 0; i < len; i++) {
|
|
2781
|
+
key = keys[i];
|
|
2782
|
+
obj[key] = arr[key];
|
|
2685
2783
|
}
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
setHeaders(header, valueOrRewrite);
|
|
2701
|
-
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2702
|
-
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
2703
|
-
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
2704
|
-
let obj = {}, dest, key;
|
|
2705
|
-
for (const entry of header) {
|
|
2706
|
-
if (!utils$1.isArray(entry)) {
|
|
2707
|
-
throw TypeError("Object iterator must return a key-value pair");
|
|
2708
|
-
}
|
|
2709
|
-
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
2784
|
+
return obj;
|
|
2785
|
+
}
|
|
2786
|
+
function formDataToJSON(formData) {
|
|
2787
|
+
function buildPath(path, value, target, index) {
|
|
2788
|
+
let name = path[index++];
|
|
2789
|
+
if (name === "__proto__") return true;
|
|
2790
|
+
const isNumericKey = Number.isFinite(+name);
|
|
2791
|
+
const isLast = index >= path.length;
|
|
2792
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
2793
|
+
if (isLast) {
|
|
2794
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
2795
|
+
target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
|
|
2796
|
+
} else {
|
|
2797
|
+
target[name] = value;
|
|
2710
2798
|
}
|
|
2711
|
-
|
|
2712
|
-
} else {
|
|
2713
|
-
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2799
|
+
return !isNumericKey;
|
|
2714
2800
|
}
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
get(header, parser) {
|
|
2718
|
-
header = normalizeHeader(header);
|
|
2719
|
-
if (header) {
|
|
2720
|
-
const key = utils$1.findKey(this, header);
|
|
2721
|
-
if (key) {
|
|
2722
|
-
const value = this[key];
|
|
2723
|
-
if (!parser) {
|
|
2724
|
-
return value;
|
|
2725
|
-
}
|
|
2726
|
-
if (parser === true) {
|
|
2727
|
-
return parseTokens(value);
|
|
2728
|
-
}
|
|
2729
|
-
if (utils$1.isFunction(parser)) {
|
|
2730
|
-
return parser.call(this, value, key);
|
|
2731
|
-
}
|
|
2732
|
-
if (utils$1.isRegExp(parser)) {
|
|
2733
|
-
return parser.exec(value);
|
|
2734
|
-
}
|
|
2735
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
|
2736
|
-
}
|
|
2801
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
2802
|
+
target[name] = [];
|
|
2737
2803
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
if (header) {
|
|
2742
|
-
const key = utils$1.findKey(this, header);
|
|
2743
|
-
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
2804
|
+
const result = buildPath(path, value, target[name], index);
|
|
2805
|
+
if (result && utils$1.isArray(target[name])) {
|
|
2806
|
+
target[name] = arrayToObject(target[name]);
|
|
2744
2807
|
}
|
|
2745
|
-
return
|
|
2808
|
+
return !isNumericKey;
|
|
2746
2809
|
}
|
|
2747
|
-
|
|
2748
|
-
const
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
const key = utils$1.findKey(self2, _header);
|
|
2754
|
-
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
2755
|
-
delete self2[key];
|
|
2756
|
-
deleted = true;
|
|
2757
|
-
}
|
|
2758
|
-
}
|
|
2759
|
-
}
|
|
2760
|
-
if (utils$1.isArray(header)) {
|
|
2761
|
-
header.forEach(deleteHeader);
|
|
2762
|
-
} else {
|
|
2763
|
-
deleteHeader(header);
|
|
2764
|
-
}
|
|
2765
|
-
return deleted;
|
|
2810
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
2811
|
+
const obj = {};
|
|
2812
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
2813
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
2814
|
+
});
|
|
2815
|
+
return obj;
|
|
2766
2816
|
}
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2817
|
+
return null;
|
|
2818
|
+
}
|
|
2819
|
+
const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0;
|
|
2820
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
2821
|
+
if (utils$1.isString(rawValue)) {
|
|
2822
|
+
try {
|
|
2823
|
+
(parser || JSON.parse)(rawValue);
|
|
2824
|
+
return utils$1.trim(rawValue);
|
|
2825
|
+
} catch (e) {
|
|
2826
|
+
if (e.name !== "SyntaxError") {
|
|
2827
|
+
throw e;
|
|
2776
2828
|
}
|
|
2777
2829
|
}
|
|
2778
|
-
return deleted;
|
|
2779
2830
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
delete self2[header];
|
|
2831
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
2832
|
+
}
|
|
2833
|
+
const defaults = {
|
|
2834
|
+
transitional: transitionalDefaults,
|
|
2835
|
+
adapter: ["xhr", "http", "fetch"],
|
|
2836
|
+
transformRequest: [
|
|
2837
|
+
function transformRequest(data, headers) {
|
|
2838
|
+
const contentType = headers.getContentType() || "";
|
|
2839
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
2840
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
2841
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
2842
|
+
data = new FormData(data);
|
|
2793
2843
|
}
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
return this;
|
|
2798
|
-
}
|
|
2799
|
-
concat(...targets) {
|
|
2800
|
-
return this.constructor.concat(this, ...targets);
|
|
2801
|
-
}
|
|
2802
|
-
toJSON(asStrings) {
|
|
2803
|
-
const obj = /* @__PURE__ */ Object.create(null);
|
|
2804
|
-
utils$1.forEach(this, (value, header) => {
|
|
2805
|
-
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
2806
|
-
});
|
|
2807
|
-
return obj;
|
|
2808
|
-
}
|
|
2809
|
-
[Symbol.iterator]() {
|
|
2810
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
2811
|
-
}
|
|
2812
|
-
toString() {
|
|
2813
|
-
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2814
|
-
}
|
|
2815
|
-
getSetCookie() {
|
|
2816
|
-
return this.get("set-cookie") || [];
|
|
2817
|
-
}
|
|
2818
|
-
get [Symbol.toStringTag]() {
|
|
2819
|
-
return "AxiosHeaders";
|
|
2820
|
-
}
|
|
2821
|
-
static from(thing) {
|
|
2822
|
-
return thing instanceof this ? thing : new this(thing);
|
|
2823
|
-
}
|
|
2824
|
-
static concat(first, ...targets) {
|
|
2825
|
-
const computed = new this(first);
|
|
2826
|
-
targets.forEach((target) => computed.set(target));
|
|
2827
|
-
return computed;
|
|
2828
|
-
}
|
|
2829
|
-
static accessor(header) {
|
|
2830
|
-
const internals = this[$internals] = this[$internals] = {
|
|
2831
|
-
accessors: {}
|
|
2832
|
-
};
|
|
2833
|
-
const accessors = internals.accessors;
|
|
2834
|
-
const prototype2 = this.prototype;
|
|
2835
|
-
function defineAccessor(_header) {
|
|
2836
|
-
const lHeader = normalizeHeader(_header);
|
|
2837
|
-
if (!accessors[lHeader]) {
|
|
2838
|
-
buildAccessors(prototype2, _header);
|
|
2839
|
-
accessors[lHeader] = true;
|
|
2844
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
2845
|
+
if (isFormData2) {
|
|
2846
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
2840
2847
|
}
|
|
2848
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
|
|
2849
|
+
return data;
|
|
2850
|
+
}
|
|
2851
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
2852
|
+
return data.buffer;
|
|
2853
|
+
}
|
|
2854
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
2855
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
2856
|
+
return data.toString();
|
|
2857
|
+
}
|
|
2858
|
+
let isFileList2;
|
|
2859
|
+
if (isObjectPayload) {
|
|
2860
|
+
const formSerializer = own(this, "formSerializer");
|
|
2861
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
2862
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
2863
|
+
}
|
|
2864
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
2865
|
+
const env = own(this, "env");
|
|
2866
|
+
const _FormData = env && env.FormData;
|
|
2867
|
+
return toFormData$1(
|
|
2868
|
+
isFileList2 ? { "files[]": data } : data,
|
|
2869
|
+
_FormData && new _FormData(),
|
|
2870
|
+
formSerializer
|
|
2871
|
+
);
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
2875
|
+
headers.setContentType("application/json", false);
|
|
2876
|
+
return stringifySafely(data);
|
|
2877
|
+
}
|
|
2878
|
+
return data;
|
|
2879
|
+
}
|
|
2880
|
+
],
|
|
2881
|
+
transformResponse: [
|
|
2882
|
+
function transformResponse(data) {
|
|
2883
|
+
const transitional2 = own(this, "transitional") || defaults.transitional;
|
|
2884
|
+
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2885
|
+
const responseType = own(this, "responseType");
|
|
2886
|
+
const JSONRequested = responseType === "json";
|
|
2887
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
2888
|
+
return data;
|
|
2889
|
+
}
|
|
2890
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
|
|
2891
|
+
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2892
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
2893
|
+
try {
|
|
2894
|
+
return JSON.parse(data, own(this, "parseReviver"));
|
|
2895
|
+
} catch (e) {
|
|
2896
|
+
if (strictJSONParsing) {
|
|
2897
|
+
if (e.name === "SyntaxError") {
|
|
2898
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, "response"));
|
|
2899
|
+
}
|
|
2900
|
+
throw e;
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
return data;
|
|
2905
|
+
}
|
|
2906
|
+
],
|
|
2907
|
+
/**
|
|
2908
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2909
|
+
* timeout is not created.
|
|
2910
|
+
*/
|
|
2911
|
+
timeout: 0,
|
|
2912
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2913
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2914
|
+
maxContentLength: -1,
|
|
2915
|
+
maxBodyLength: -1,
|
|
2916
|
+
env: {
|
|
2917
|
+
FormData: platform.classes.FormData,
|
|
2918
|
+
Blob: platform.classes.Blob
|
|
2919
|
+
},
|
|
2920
|
+
validateStatus: function validateStatus(status) {
|
|
2921
|
+
return status >= 200 && status < 300;
|
|
2922
|
+
},
|
|
2923
|
+
headers: {
|
|
2924
|
+
common: {
|
|
2925
|
+
Accept: "application/json, text/plain, */*",
|
|
2926
|
+
"Content-Type": void 0
|
|
2841
2927
|
}
|
|
2842
|
-
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
2843
|
-
return this;
|
|
2844
2928
|
}
|
|
2845
2929
|
};
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
"Content-Length",
|
|
2849
|
-
"Accept",
|
|
2850
|
-
"Accept-Encoding",
|
|
2851
|
-
"User-Agent",
|
|
2852
|
-
"Authorization"
|
|
2853
|
-
]);
|
|
2854
|
-
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
2855
|
-
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
2856
|
-
return {
|
|
2857
|
-
get: () => value,
|
|
2858
|
-
set(headerValue) {
|
|
2859
|
-
this[mapped] = headerValue;
|
|
2860
|
-
}
|
|
2861
|
-
};
|
|
2930
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => {
|
|
2931
|
+
defaults.headers[method] = {};
|
|
2862
2932
|
});
|
|
2863
|
-
utils$1.freezeMethods(AxiosHeaders$1);
|
|
2864
2933
|
function transformData(fns, response) {
|
|
2865
2934
|
const config = this || defaults;
|
|
2866
2935
|
const context = response || config;
|
|
@@ -2896,19 +2965,17 @@ function settle(resolve, reject, response) {
|
|
|
2896
2965
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
2897
2966
|
resolve(response);
|
|
2898
2967
|
} else {
|
|
2899
|
-
reject(
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
)
|
|
2907
|
-
);
|
|
2968
|
+
reject(new AxiosError$1(
|
|
2969
|
+
"Request failed with status code " + response.status,
|
|
2970
|
+
response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
|
|
2971
|
+
response.config,
|
|
2972
|
+
response.request,
|
|
2973
|
+
response
|
|
2974
|
+
));
|
|
2908
2975
|
}
|
|
2909
2976
|
}
|
|
2910
2977
|
function parseProtocol(url) {
|
|
2911
|
-
const match2 = /^([-+\w]{1,25})(
|
|
2978
|
+
const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
2912
2979
|
return match2 && match2[1] || "";
|
|
2913
2980
|
}
|
|
2914
2981
|
function speedometer(samplesCount, min) {
|
|
@@ -3044,8 +3111,15 @@ const cookies = platform.hasStandardBrowserEnv ? (
|
|
|
3044
3111
|
},
|
|
3045
3112
|
read(name) {
|
|
3046
3113
|
if (typeof document === "undefined") return null;
|
|
3047
|
-
const
|
|
3048
|
-
|
|
3114
|
+
const cookies2 = document.cookie.split(";");
|
|
3115
|
+
for (let i = 0; i < cookies2.length; i++) {
|
|
3116
|
+
const cookie = cookies2[i].replace(/^\s+/, "");
|
|
3117
|
+
const eq = cookie.indexOf("=");
|
|
3118
|
+
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
3119
|
+
return decodeURIComponent(cookie.slice(eq + 1));
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
return null;
|
|
3049
3123
|
},
|
|
3050
3124
|
remove(name) {
|
|
3051
3125
|
this.write(name, "", Date.now() - 864e5, "/");
|
|
@@ -3084,6 +3158,9 @@ function mergeConfig$1(config1, config2) {
|
|
|
3084
3158
|
config2 = config2 || {};
|
|
3085
3159
|
const config = /* @__PURE__ */ Object.create(null);
|
|
3086
3160
|
Object.defineProperty(config, "hasOwnProperty", {
|
|
3161
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
3162
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
3163
|
+
__proto__: null,
|
|
3087
3164
|
value: Object.prototype.hasOwnProperty,
|
|
3088
3165
|
enumerable: false,
|
|
3089
3166
|
writable: true,
|
|
@@ -3167,6 +3244,22 @@ function mergeConfig$1(config1, config2) {
|
|
|
3167
3244
|
});
|
|
3168
3245
|
return config;
|
|
3169
3246
|
}
|
|
3247
|
+
const FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
|
|
3248
|
+
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
3249
|
+
if (policy !== "content-only") {
|
|
3250
|
+
headers.set(formHeaders);
|
|
3251
|
+
return;
|
|
3252
|
+
}
|
|
3253
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
3254
|
+
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
3255
|
+
headers.set(key, val);
|
|
3256
|
+
}
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3259
|
+
const encodeUTF8 = (str) => encodeURIComponent(str).replace(
|
|
3260
|
+
/%([0-9A-F]{2})/gi,
|
|
3261
|
+
(_, hex) => String.fromCharCode(parseInt(hex, 16))
|
|
3262
|
+
);
|
|
3170
3263
|
const resolveConfig = (config) => {
|
|
3171
3264
|
const newConfig = mergeConfig$1({}, config);
|
|
3172
3265
|
const own2 = (key) => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
|
|
@@ -3188,22 +3281,14 @@ const resolveConfig = (config) => {
|
|
|
3188
3281
|
if (auth) {
|
|
3189
3282
|
headers.set(
|
|
3190
3283
|
"Authorization",
|
|
3191
|
-
"Basic " + btoa(
|
|
3192
|
-
(auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
|
|
3193
|
-
)
|
|
3284
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : ""))
|
|
3194
3285
|
);
|
|
3195
3286
|
}
|
|
3196
3287
|
if (utils$1.isFormData(data)) {
|
|
3197
3288
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
3198
3289
|
headers.setContentType(void 0);
|
|
3199
3290
|
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
3200
|
-
|
|
3201
|
-
const allowedHeaders = ["content-type", "content-length"];
|
|
3202
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
3203
|
-
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
3204
|
-
headers.set(key, val);
|
|
3205
|
-
}
|
|
3206
|
-
});
|
|
3291
|
+
setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
|
|
3207
3292
|
}
|
|
3208
3293
|
}
|
|
3209
3294
|
if (platform.hasStandardBrowserEnv) {
|
|
@@ -3275,7 +3360,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
3275
3360
|
if (!request || request.readyState !== 4) {
|
|
3276
3361
|
return;
|
|
3277
3362
|
}
|
|
3278
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.
|
|
3363
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) {
|
|
3279
3364
|
return;
|
|
3280
3365
|
}
|
|
3281
3366
|
setTimeout(onloadend);
|
|
@@ -3286,6 +3371,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
3286
3371
|
return;
|
|
3287
3372
|
}
|
|
3288
3373
|
reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
|
|
3374
|
+
done();
|
|
3289
3375
|
request = null;
|
|
3290
3376
|
};
|
|
3291
3377
|
request.onerror = function handleError(event) {
|
|
@@ -3293,6 +3379,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
3293
3379
|
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
3294
3380
|
err.event = event || null;
|
|
3295
3381
|
reject(err);
|
|
3382
|
+
done();
|
|
3296
3383
|
request = null;
|
|
3297
3384
|
};
|
|
3298
3385
|
request.ontimeout = function handleTimeout() {
|
|
@@ -3309,6 +3396,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
3309
3396
|
request
|
|
3310
3397
|
)
|
|
3311
3398
|
);
|
|
3399
|
+
done();
|
|
3312
3400
|
request = null;
|
|
3313
3401
|
};
|
|
3314
3402
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
@@ -3339,6 +3427,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
3339
3427
|
}
|
|
3340
3428
|
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
3341
3429
|
request.abort();
|
|
3430
|
+
done();
|
|
3342
3431
|
request = null;
|
|
3343
3432
|
};
|
|
3344
3433
|
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
@@ -3347,7 +3436,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
3347
3436
|
}
|
|
3348
3437
|
}
|
|
3349
3438
|
const protocol = parseProtocol(_config.url);
|
|
3350
|
-
if (protocol && platform.protocols.
|
|
3439
|
+
if (protocol && !platform.protocols.includes(protocol)) {
|
|
3351
3440
|
reject(
|
|
3352
3441
|
new AxiosError$1(
|
|
3353
3442
|
"Unsupported protocol " + protocol + ":",
|
|
@@ -3473,13 +3562,80 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
3473
3562
|
}
|
|
3474
3563
|
);
|
|
3475
3564
|
};
|
|
3565
|
+
function estimateDataURLDecodedBytes(url) {
|
|
3566
|
+
if (!url || typeof url !== "string") return 0;
|
|
3567
|
+
if (!url.startsWith("data:")) return 0;
|
|
3568
|
+
const comma = url.indexOf(",");
|
|
3569
|
+
if (comma < 0) return 0;
|
|
3570
|
+
const meta = url.slice(5, comma);
|
|
3571
|
+
const body = url.slice(comma + 1);
|
|
3572
|
+
const isBase64 = /;base64/i.test(meta);
|
|
3573
|
+
if (isBase64) {
|
|
3574
|
+
let effectiveLen = body.length;
|
|
3575
|
+
const len = body.length;
|
|
3576
|
+
for (let i = 0; i < len; i++) {
|
|
3577
|
+
if (body.charCodeAt(i) === 37 && i + 2 < len) {
|
|
3578
|
+
const a = body.charCodeAt(i + 1);
|
|
3579
|
+
const b = body.charCodeAt(i + 2);
|
|
3580
|
+
const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
|
|
3581
|
+
if (isHex) {
|
|
3582
|
+
effectiveLen -= 2;
|
|
3583
|
+
i += 2;
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
let pad = 0;
|
|
3588
|
+
let idx = len - 1;
|
|
3589
|
+
const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
|
|
3590
|
+
body.charCodeAt(j - 1) === 51 && // '3'
|
|
3591
|
+
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
|
|
3592
|
+
if (idx >= 0) {
|
|
3593
|
+
if (body.charCodeAt(idx) === 61) {
|
|
3594
|
+
pad++;
|
|
3595
|
+
idx--;
|
|
3596
|
+
} else if (tailIsPct3D(idx)) {
|
|
3597
|
+
pad++;
|
|
3598
|
+
idx -= 3;
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
if (pad === 1 && idx >= 0) {
|
|
3602
|
+
if (body.charCodeAt(idx) === 61) {
|
|
3603
|
+
pad++;
|
|
3604
|
+
} else if (tailIsPct3D(idx)) {
|
|
3605
|
+
pad++;
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
const groups = Math.floor(effectiveLen / 4);
|
|
3609
|
+
const bytes2 = groups * 3 - (pad || 0);
|
|
3610
|
+
return bytes2 > 0 ? bytes2 : 0;
|
|
3611
|
+
}
|
|
3612
|
+
if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") {
|
|
3613
|
+
return Buffer.byteLength(body, "utf8");
|
|
3614
|
+
}
|
|
3615
|
+
let bytes = 0;
|
|
3616
|
+
for (let i = 0, len = body.length; i < len; i++) {
|
|
3617
|
+
const c = body.charCodeAt(i);
|
|
3618
|
+
if (c < 128) {
|
|
3619
|
+
bytes += 1;
|
|
3620
|
+
} else if (c < 2048) {
|
|
3621
|
+
bytes += 2;
|
|
3622
|
+
} else if (c >= 55296 && c <= 56319 && i + 1 < len) {
|
|
3623
|
+
const next = body.charCodeAt(i + 1);
|
|
3624
|
+
if (next >= 56320 && next <= 57343) {
|
|
3625
|
+
bytes += 4;
|
|
3626
|
+
i++;
|
|
3627
|
+
} else {
|
|
3628
|
+
bytes += 3;
|
|
3629
|
+
}
|
|
3630
|
+
} else {
|
|
3631
|
+
bytes += 3;
|
|
3632
|
+
}
|
|
3633
|
+
}
|
|
3634
|
+
return bytes;
|
|
3635
|
+
}
|
|
3636
|
+
const VERSION$1 = "1.16.0";
|
|
3476
3637
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3477
3638
|
const { isFunction } = utils$1;
|
|
3478
|
-
const globalFetchAPI = (({ Request, Response }) => ({
|
|
3479
|
-
Request,
|
|
3480
|
-
Response
|
|
3481
|
-
}))(utils$1.global);
|
|
3482
|
-
const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
|
|
3483
3639
|
const test = (fn, ...args) => {
|
|
3484
3640
|
try {
|
|
3485
3641
|
return !!fn(...args);
|
|
@@ -3488,11 +3644,16 @@ const test = (fn, ...args) => {
|
|
|
3488
3644
|
}
|
|
3489
3645
|
};
|
|
3490
3646
|
const factory = (env) => {
|
|
3647
|
+
const globalObject = utils$1.global ?? globalThis;
|
|
3648
|
+
const { ReadableStream: ReadableStream2, TextEncoder } = globalObject;
|
|
3491
3649
|
env = utils$1.merge.call(
|
|
3492
3650
|
{
|
|
3493
3651
|
skipUndefined: true
|
|
3494
3652
|
},
|
|
3495
|
-
|
|
3653
|
+
{
|
|
3654
|
+
Request: globalObject.Request,
|
|
3655
|
+
Response: globalObject.Response
|
|
3656
|
+
},
|
|
3496
3657
|
env
|
|
3497
3658
|
);
|
|
3498
3659
|
const { fetch: envFetch, Request, Response } = env;
|
|
@@ -3502,12 +3663,12 @@ const factory = (env) => {
|
|
|
3502
3663
|
if (!isFetchSupported) {
|
|
3503
3664
|
return false;
|
|
3504
3665
|
}
|
|
3505
|
-
const isReadableStreamSupported = isFetchSupported && isFunction(
|
|
3666
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream2);
|
|
3506
3667
|
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
3507
3668
|
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
3508
3669
|
let duplexAccessed = false;
|
|
3509
3670
|
const request = new Request(platform.origin, {
|
|
3510
|
-
body: new
|
|
3671
|
+
body: new ReadableStream2(),
|
|
3511
3672
|
method: "POST",
|
|
3512
3673
|
get duplex() {
|
|
3513
3674
|
duplexAccessed = true;
|
|
@@ -3580,8 +3741,12 @@ const factory = (env) => {
|
|
|
3580
3741
|
responseType,
|
|
3581
3742
|
headers,
|
|
3582
3743
|
withCredentials = "same-origin",
|
|
3583
|
-
fetchOptions
|
|
3744
|
+
fetchOptions,
|
|
3745
|
+
maxContentLength,
|
|
3746
|
+
maxBodyLength
|
|
3584
3747
|
} = resolveConfig(config);
|
|
3748
|
+
const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
3749
|
+
const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
3585
3750
|
let _fetch = envFetch || fetch;
|
|
3586
3751
|
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
3587
3752
|
let composedSignal = composeSignals(
|
|
@@ -3594,6 +3759,28 @@ const factory = (env) => {
|
|
|
3594
3759
|
});
|
|
3595
3760
|
let requestContentLength;
|
|
3596
3761
|
try {
|
|
3762
|
+
if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) {
|
|
3763
|
+
const estimated = estimateDataURLDecodedBytes(url);
|
|
3764
|
+
if (estimated > maxContentLength) {
|
|
3765
|
+
throw new AxiosError$1(
|
|
3766
|
+
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
3767
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3768
|
+
config,
|
|
3769
|
+
request
|
|
3770
|
+
);
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
if (hasMaxBodyLength && method !== "get" && method !== "head") {
|
|
3774
|
+
const outboundLength = await resolveBodyLength(headers, data);
|
|
3775
|
+
if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) {
|
|
3776
|
+
throw new AxiosError$1(
|
|
3777
|
+
"Request body larger than maxBodyLength limit",
|
|
3778
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
3779
|
+
config,
|
|
3780
|
+
request
|
|
3781
|
+
);
|
|
3782
|
+
}
|
|
3783
|
+
}
|
|
3597
3784
|
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
3598
3785
|
let _request = new Request(url, {
|
|
3599
3786
|
method: "POST",
|
|
@@ -3622,6 +3809,7 @@ const factory = (env) => {
|
|
|
3622
3809
|
headers.delete("content-type");
|
|
3623
3810
|
}
|
|
3624
3811
|
}
|
|
3812
|
+
headers.set("User-Agent", "axios/" + VERSION$1, false);
|
|
3625
3813
|
const resolvedOptions = {
|
|
3626
3814
|
...fetchOptions,
|
|
3627
3815
|
signal: composedSignal,
|
|
@@ -3633,8 +3821,19 @@ const factory = (env) => {
|
|
|
3633
3821
|
};
|
|
3634
3822
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
3635
3823
|
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
3824
|
+
if (hasMaxContentLength) {
|
|
3825
|
+
const declaredLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
3826
|
+
if (declaredLength != null && declaredLength > maxContentLength) {
|
|
3827
|
+
throw new AxiosError$1(
|
|
3828
|
+
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
3829
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3830
|
+
config,
|
|
3831
|
+
request
|
|
3832
|
+
);
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3636
3835
|
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
3637
|
-
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
3836
|
+
if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
|
|
3638
3837
|
const options = {};
|
|
3639
3838
|
["status", "statusText", "headers"].forEach((prop) => {
|
|
3640
3839
|
options[prop] = response[prop];
|
|
@@ -3644,8 +3843,23 @@ const factory = (env) => {
|
|
|
3644
3843
|
responseContentLength,
|
|
3645
3844
|
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3646
3845
|
) || [];
|
|
3846
|
+
let bytesRead = 0;
|
|
3847
|
+
const onChunkProgress = (loadedBytes) => {
|
|
3848
|
+
if (hasMaxContentLength) {
|
|
3849
|
+
bytesRead = loadedBytes;
|
|
3850
|
+
if (bytesRead > maxContentLength) {
|
|
3851
|
+
throw new AxiosError$1(
|
|
3852
|
+
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
3853
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3854
|
+
config,
|
|
3855
|
+
request
|
|
3856
|
+
);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
onProgress && onProgress(loadedBytes);
|
|
3860
|
+
};
|
|
3647
3861
|
response = new Response(
|
|
3648
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE,
|
|
3862
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
|
|
3649
3863
|
flush && flush();
|
|
3650
3864
|
unsubscribe && unsubscribe();
|
|
3651
3865
|
}),
|
|
@@ -3657,6 +3871,26 @@ const factory = (env) => {
|
|
|
3657
3871
|
response,
|
|
3658
3872
|
config
|
|
3659
3873
|
);
|
|
3874
|
+
if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
|
|
3875
|
+
let materializedSize;
|
|
3876
|
+
if (responseData != null) {
|
|
3877
|
+
if (typeof responseData.byteLength === "number") {
|
|
3878
|
+
materializedSize = responseData.byteLength;
|
|
3879
|
+
} else if (typeof responseData.size === "number") {
|
|
3880
|
+
materializedSize = responseData.size;
|
|
3881
|
+
} else if (typeof responseData === "string") {
|
|
3882
|
+
materializedSize = typeof TextEncoder === "function" ? new TextEncoder().encode(responseData).byteLength : responseData.length;
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
if (typeof materializedSize === "number" && materializedSize > maxContentLength) {
|
|
3886
|
+
throw new AxiosError$1(
|
|
3887
|
+
"maxContentLength size of " + maxContentLength + " exceeded",
|
|
3888
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3889
|
+
config,
|
|
3890
|
+
request
|
|
3891
|
+
);
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3660
3894
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3661
3895
|
return await new Promise((resolve, reject) => {
|
|
3662
3896
|
settle(resolve, reject, {
|
|
@@ -3670,6 +3904,13 @@ const factory = (env) => {
|
|
|
3670
3904
|
});
|
|
3671
3905
|
} catch (err) {
|
|
3672
3906
|
unsubscribe && unsubscribe();
|
|
3907
|
+
if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
|
|
3908
|
+
const canceledError = composedSignal.reason;
|
|
3909
|
+
canceledError.config = config;
|
|
3910
|
+
request && (canceledError.request = request);
|
|
3911
|
+
err !== canceledError && (canceledError.cause = err);
|
|
3912
|
+
throw canceledError;
|
|
3913
|
+
}
|
|
3673
3914
|
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
3674
3915
|
throw Object.assign(
|
|
3675
3916
|
new AxiosError$1(
|
|
@@ -3713,10 +3954,10 @@ const knownAdapters = {
|
|
|
3713
3954
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
3714
3955
|
if (fn) {
|
|
3715
3956
|
try {
|
|
3716
|
-
Object.defineProperty(fn, "name", { value });
|
|
3957
|
+
Object.defineProperty(fn, "name", { __proto__: null, value });
|
|
3717
3958
|
} catch (e) {
|
|
3718
3959
|
}
|
|
3719
|
-
Object.defineProperty(fn, "adapterName", { value });
|
|
3960
|
+
Object.defineProperty(fn, "adapterName", { __proto__: null, value });
|
|
3720
3961
|
}
|
|
3721
3962
|
});
|
|
3722
3963
|
const renderReason = (reason) => `- ${reason}`;
|
|
@@ -3785,7 +4026,12 @@ function dispatchRequest(config) {
|
|
|
3785
4026
|
return adapter(config).then(
|
|
3786
4027
|
function onAdapterResolution(response) {
|
|
3787
4028
|
throwIfCancellationRequested(config);
|
|
3788
|
-
response
|
|
4029
|
+
config.response = response;
|
|
4030
|
+
try {
|
|
4031
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
4032
|
+
} finally {
|
|
4033
|
+
delete config.response;
|
|
4034
|
+
}
|
|
3789
4035
|
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3790
4036
|
return response;
|
|
3791
4037
|
},
|
|
@@ -3793,11 +4039,16 @@ function dispatchRequest(config) {
|
|
|
3793
4039
|
if (!isCancel$1(reason)) {
|
|
3794
4040
|
throwIfCancellationRequested(config);
|
|
3795
4041
|
if (reason && reason.response) {
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
4042
|
+
config.response = reason.response;
|
|
4043
|
+
try {
|
|
4044
|
+
reason.response.data = transformData.call(
|
|
4045
|
+
config,
|
|
4046
|
+
config.transformResponse,
|
|
4047
|
+
reason.response
|
|
4048
|
+
);
|
|
4049
|
+
} finally {
|
|
4050
|
+
delete config.response;
|
|
4051
|
+
}
|
|
3801
4052
|
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
3802
4053
|
}
|
|
3803
4054
|
}
|
|
@@ -3805,7 +4056,6 @@ function dispatchRequest(config) {
|
|
|
3805
4056
|
}
|
|
3806
4057
|
);
|
|
3807
4058
|
}
|
|
3808
|
-
const VERSION$1 = "1.15.2";
|
|
3809
4059
|
const validators$1 = {};
|
|
3810
4060
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
3811
4061
|
validators$1[type] = function validator2(thing) {
|
|
@@ -3972,7 +4222,7 @@ let Axios$1 = class Axios {
|
|
|
3972
4222
|
);
|
|
3973
4223
|
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
3974
4224
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
3975
|
-
headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
|
|
4225
|
+
headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => {
|
|
3976
4226
|
delete headers[method];
|
|
3977
4227
|
});
|
|
3978
4228
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
@@ -4050,7 +4300,7 @@ utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoDa
|
|
|
4050
4300
|
);
|
|
4051
4301
|
};
|
|
4052
4302
|
});
|
|
4053
|
-
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
4303
|
+
utils$1.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
|
|
4054
4304
|
function generateHTTPMethod(isForm) {
|
|
4055
4305
|
return function httpMethod(url, data, config) {
|
|
4056
4306
|
return this.request(
|
|
@@ -4066,7 +4316,9 @@ utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method)
|
|
|
4066
4316
|
};
|
|
4067
4317
|
}
|
|
4068
4318
|
Axios$1.prototype[method] = generateHTTPMethod();
|
|
4069
|
-
|
|
4319
|
+
if (method !== "query") {
|
|
4320
|
+
Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
4321
|
+
}
|
|
4070
4322
|
});
|
|
4071
4323
|
let CancelToken$1 = class CancelToken {
|
|
4072
4324
|
constructor(executor) {
|
|
@@ -4250,7 +4502,7 @@ function createInstance(defaultConfig) {
|
|
|
4250
4502
|
const instance = bind(Axios$1.prototype.request, context);
|
|
4251
4503
|
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
4252
4504
|
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
4253
|
-
instance.create = function
|
|
4505
|
+
instance.create = function create2(instanceConfig) {
|
|
4254
4506
|
return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
|
|
4255
4507
|
};
|
|
4256
4508
|
return instance;
|
|
@@ -4291,7 +4543,8 @@ const {
|
|
|
4291
4543
|
HttpStatusCode,
|
|
4292
4544
|
formToJSON,
|
|
4293
4545
|
getAdapter,
|
|
4294
|
-
mergeConfig
|
|
4546
|
+
mergeConfig,
|
|
4547
|
+
create
|
|
4295
4548
|
} = axios;
|
|
4296
4549
|
function useDownload() {
|
|
4297
4550
|
const isDownloading = vue.ref(false);
|
|
@@ -12222,6 +12475,21 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
|
12222
12475
|
};
|
|
12223
12476
|
}
|
|
12224
12477
|
});
|
|
12478
|
+
function useElementFinalSize(elementRef, onFinalSize, delay = 100) {
|
|
12479
|
+
vue.watchEffect((onCleanup) => {
|
|
12480
|
+
const { value: element } = elementRef;
|
|
12481
|
+
if (!element) return;
|
|
12482
|
+
const timeoutId = setTimeout(() => {
|
|
12483
|
+
requestAnimationFrame(() => {
|
|
12484
|
+
const { height } = element.getBoundingClientRect();
|
|
12485
|
+
if (height > 0) {
|
|
12486
|
+
onFinalSize(height);
|
|
12487
|
+
}
|
|
12488
|
+
});
|
|
12489
|
+
}, delay);
|
|
12490
|
+
onCleanup(() => clearTimeout(timeoutId));
|
|
12491
|
+
});
|
|
12492
|
+
}
|
|
12225
12493
|
const getTitleFromProperties = (node, titleTemplate) => {
|
|
12226
12494
|
if (!titleTemplate) {
|
|
12227
12495
|
return node.title;
|
|
@@ -12263,11 +12531,85 @@ const getNodePropertyValue = (node, property) => {
|
|
|
12263
12531
|
};
|
|
12264
12532
|
const useTreeState = (options = {}) => {
|
|
12265
12533
|
const triggerLength = options?.searchInputTriggerLength ?? 1;
|
|
12534
|
+
const nodeIndex = /* @__PURE__ */ new Map();
|
|
12535
|
+
const subtreeNodeIdsIndex = /* @__PURE__ */ new Map();
|
|
12536
|
+
const selectedNodeObjectIds = vue.reactive(/* @__PURE__ */ new Set());
|
|
12537
|
+
const parentOrChildrenSelectedCache = /* @__PURE__ */ new Map();
|
|
12538
|
+
const parentAndAllChildrenSelectedCache = /* @__PURE__ */ new Map();
|
|
12539
|
+
const parentOnlySelectedCache = /* @__PURE__ */ new Map();
|
|
12540
|
+
const nodeIndeterminateByIdCache = /* @__PURE__ */ new Map();
|
|
12266
12541
|
const selectedNodes = vue.reactive(/* @__PURE__ */ new Set());
|
|
12267
12542
|
const selectedNodeObjects = vue.reactive([]);
|
|
12268
12543
|
const expandedNodes = vue.reactive(/* @__PURE__ */ new Set());
|
|
12269
12544
|
const searchTerm = vue.ref("");
|
|
12270
12545
|
const isEmptySearchResult = vue.ref(false);
|
|
12546
|
+
const selectionVersion = vue.ref(0);
|
|
12547
|
+
const clearDerivedSelectionCaches = () => {
|
|
12548
|
+
parentOrChildrenSelectedCache.clear();
|
|
12549
|
+
parentAndAllChildrenSelectedCache.clear();
|
|
12550
|
+
parentOnlySelectedCache.clear();
|
|
12551
|
+
nodeIndeterminateByIdCache.clear();
|
|
12552
|
+
};
|
|
12553
|
+
const bumpSelectionVersion = () => {
|
|
12554
|
+
selectionVersion.value += 1;
|
|
12555
|
+
};
|
|
12556
|
+
const indexNodes = (nodes) => {
|
|
12557
|
+
for (const rootNode of nodes) {
|
|
12558
|
+
const stack = [rootNode];
|
|
12559
|
+
while (stack.length > 0) {
|
|
12560
|
+
const node = stack.pop();
|
|
12561
|
+
nodeIndex.set(node.nodeId, node);
|
|
12562
|
+
if (node.children && node.children.length > 0) {
|
|
12563
|
+
for (const child of node.children) stack.push(child);
|
|
12564
|
+
}
|
|
12565
|
+
}
|
|
12566
|
+
}
|
|
12567
|
+
};
|
|
12568
|
+
const getSubtreeNodeIds = (node) => {
|
|
12569
|
+
const cached = subtreeNodeIdsIndex.get(node.nodeId);
|
|
12570
|
+
if (cached) return cached;
|
|
12571
|
+
const ids = [];
|
|
12572
|
+
const stack = [node];
|
|
12573
|
+
while (stack.length > 0) {
|
|
12574
|
+
const current = stack.pop();
|
|
12575
|
+
ids.push(current.nodeId);
|
|
12576
|
+
if (current.children && current.children.length > 0) {
|
|
12577
|
+
for (const child of current.children) stack.push(child);
|
|
12578
|
+
}
|
|
12579
|
+
}
|
|
12580
|
+
subtreeNodeIdsIndex.set(node.nodeId, ids);
|
|
12581
|
+
return ids;
|
|
12582
|
+
};
|
|
12583
|
+
const addNodesToSelection = (nodes) => {
|
|
12584
|
+
let hasChanges = false;
|
|
12585
|
+
const nodesToAppend = [];
|
|
12586
|
+
for (const node of nodes) {
|
|
12587
|
+
if (selectedNodes.has(node.nodeId)) continue;
|
|
12588
|
+
hasChanges = true;
|
|
12589
|
+
selectedNodes.add(node.nodeId);
|
|
12590
|
+
selectedNodeObjectIds.add(node.nodeId);
|
|
12591
|
+
nodesToAppend.push(node);
|
|
12592
|
+
}
|
|
12593
|
+
if (nodesToAppend.length > 0) selectedNodeObjects.push(...nodesToAppend);
|
|
12594
|
+
if (hasChanges) bumpSelectionVersion();
|
|
12595
|
+
};
|
|
12596
|
+
const removeNodeIdsFromSelection = (nodeIds) => {
|
|
12597
|
+
if (nodeIds.size === 0) return;
|
|
12598
|
+
let hasChanges = false;
|
|
12599
|
+
const filteredNodes = [];
|
|
12600
|
+
nodeIds.forEach((nodeId) => {
|
|
12601
|
+
if (selectedNodes.delete(nodeId)) hasChanges = true;
|
|
12602
|
+
selectedNodeObjectIds.delete(nodeId);
|
|
12603
|
+
});
|
|
12604
|
+
if (hasChanges) {
|
|
12605
|
+
for (const node of selectedNodeObjects) {
|
|
12606
|
+
if (!nodeIds.has(node.nodeId)) filteredNodes.push(node);
|
|
12607
|
+
}
|
|
12608
|
+
selectedNodeObjects.splice(0, selectedNodeObjects.length, ...filteredNodes);
|
|
12609
|
+
bumpSelectionVersion();
|
|
12610
|
+
}
|
|
12611
|
+
};
|
|
12612
|
+
indexNodes(Array.isArray(options.nodes) ? options.nodes : []);
|
|
12271
12613
|
vue.watch(searchTerm, (newTerm) => {
|
|
12272
12614
|
if (!newTerm.trim() || newTerm.length < triggerLength) {
|
|
12273
12615
|
isEmptySearchResult.value = false;
|
|
@@ -12279,8 +12621,12 @@ const useTreeState = (options = {}) => {
|
|
|
12279
12621
|
}
|
|
12280
12622
|
});
|
|
12281
12623
|
const clearAllSelectedNodes = () => {
|
|
12624
|
+
const hadSelection = selectedNodes.size > 0;
|
|
12282
12625
|
selectedNodes.clear();
|
|
12626
|
+
selectedNodeObjectIds.clear();
|
|
12283
12627
|
selectedNodeObjects.length = 0;
|
|
12628
|
+
clearDerivedSelectionCaches();
|
|
12629
|
+
if (hadSelection) bumpSelectionVersion();
|
|
12284
12630
|
};
|
|
12285
12631
|
const collapseAllExpandedNodes = () => expandedNodes.clear();
|
|
12286
12632
|
const isNodeSelected = (nodeId) => selectedNodes.has(nodeId);
|
|
@@ -12290,8 +12636,10 @@ const useTreeState = (options = {}) => {
|
|
|
12290
12636
|
const injectNode = (nodeObject) => {
|
|
12291
12637
|
if (selectedNodes.has(nodeObject.nodeId)) return;
|
|
12292
12638
|
selectedNodes.add(nodeObject.nodeId);
|
|
12293
|
-
if (!
|
|
12639
|
+
if (!selectedNodeObjectIds.has(nodeObject.nodeId)) {
|
|
12294
12640
|
selectedNodeObjects.push(nodeObject);
|
|
12641
|
+
selectedNodeObjectIds.add(nodeObject.nodeId);
|
|
12642
|
+
bumpSelectionVersion();
|
|
12295
12643
|
}
|
|
12296
12644
|
};
|
|
12297
12645
|
const expandAllChildren = (node) => {
|
|
@@ -12301,93 +12649,82 @@ const useTreeState = (options = {}) => {
|
|
|
12301
12649
|
}
|
|
12302
12650
|
};
|
|
12303
12651
|
const selectAllChildren = (node) => {
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
}
|
|
12652
|
+
const subtreeIds = getSubtreeNodeIds(node);
|
|
12653
|
+
const nodesToAdd = [];
|
|
12654
|
+
for (const id of subtreeIds) {
|
|
12655
|
+
if (selectedNodes.has(id)) continue;
|
|
12656
|
+
const subtreeNode = nodeIndex.get(id);
|
|
12657
|
+
if (subtreeNode) nodesToAdd.push(subtreeNode);
|
|
12658
|
+
}
|
|
12659
|
+
addNodesToSelection(nodesToAdd);
|
|
12311
12660
|
if (options.expandChildrenOnParentCheck) {
|
|
12312
12661
|
expandAllChildren(node);
|
|
12313
12662
|
}
|
|
12314
12663
|
};
|
|
12315
12664
|
const selectNodeAndAllChildren = (nodeId) => {
|
|
12316
|
-
const node =
|
|
12665
|
+
const node = nodeIndex.get(nodeId);
|
|
12317
12666
|
if (!node) return;
|
|
12318
|
-
|
|
12319
|
-
|
|
12320
|
-
node.children.forEach(selectAllChildren);
|
|
12321
|
-
}
|
|
12667
|
+
selectAllChildren(node);
|
|
12668
|
+
clearDerivedSelectionCaches();
|
|
12322
12669
|
};
|
|
12323
12670
|
const deselectNode = (nodeId) => {
|
|
12324
|
-
selectedNodes.delete(nodeId);
|
|
12671
|
+
const hadSelection = selectedNodes.delete(nodeId);
|
|
12672
|
+
selectedNodeObjectIds.delete(nodeId);
|
|
12325
12673
|
const index = selectedNodeObjects.findIndex((node) => node.nodeId === nodeId);
|
|
12326
12674
|
if (index > -1) {
|
|
12327
12675
|
selectedNodeObjects.splice(index, 1);
|
|
12328
12676
|
}
|
|
12677
|
+
clearDerivedSelectionCaches();
|
|
12678
|
+
if (hadSelection) bumpSelectionVersion();
|
|
12329
12679
|
};
|
|
12330
12680
|
const deselectNodeAndAllChildren = (node) => {
|
|
12331
|
-
|
|
12332
|
-
if (node.children && node.children.length > 0) {
|
|
12333
|
-
node.children.forEach(deselectNodeAndAllChildren);
|
|
12334
|
-
}
|
|
12681
|
+
removeNodeIdsFromSelection(new Set(getSubtreeNodeIds(node)));
|
|
12335
12682
|
};
|
|
12336
12683
|
const deselectChildrenOnly = (nodeId) => {
|
|
12337
|
-
const node =
|
|
12684
|
+
const node = nodeIndex.get(nodeId);
|
|
12338
12685
|
if (!node) return;
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
node.children.forEach(deselectNodeAndAllChildren);
|
|
12345
|
-
}
|
|
12346
|
-
};
|
|
12347
|
-
const findNodeById = (nodes, nodeId) => {
|
|
12348
|
-
for (const node of nodes) {
|
|
12349
|
-
if (node.nodeId === nodeId) {
|
|
12350
|
-
return node;
|
|
12351
|
-
}
|
|
12352
|
-
if (node.children) {
|
|
12353
|
-
const found = findNodeById(node.children, nodeId);
|
|
12354
|
-
if (found) return found;
|
|
12355
|
-
}
|
|
12356
|
-
}
|
|
12357
|
-
return null;
|
|
12358
|
-
};
|
|
12359
|
-
const findNodeObjectById = (nodeId) => {
|
|
12360
|
-
const nodes = Array.isArray(options.nodes) ? options.nodes : [];
|
|
12361
|
-
for (const node of nodes) {
|
|
12362
|
-
if (node.nodeId === nodeId) {
|
|
12363
|
-
return node;
|
|
12364
|
-
}
|
|
12365
|
-
if (node.children) {
|
|
12366
|
-
const found = findNodeById(node.children, nodeId);
|
|
12367
|
-
if (found) return found;
|
|
12686
|
+
addNodesToSelection([node]);
|
|
12687
|
+
const childNodeIds = /* @__PURE__ */ new Set();
|
|
12688
|
+
if (node.children) {
|
|
12689
|
+
for (const child of node.children) {
|
|
12690
|
+
getSubtreeNodeIds(child).forEach((id) => childNodeIds.add(id));
|
|
12368
12691
|
}
|
|
12369
12692
|
}
|
|
12370
|
-
|
|
12693
|
+
removeNodeIdsFromSelection(childNodeIds);
|
|
12694
|
+
clearDerivedSelectionCaches();
|
|
12371
12695
|
};
|
|
12696
|
+
const findNodeObjectById = (nodeId) => nodeIndex.get(nodeId) ?? null;
|
|
12372
12697
|
const hasChildrenNodes = (nodes) => nodes.length > 0;
|
|
12373
12698
|
const absoluteTopNodeHasChildren = () => {
|
|
12374
12699
|
const rootNode = Array.isArray(options.nodes) && options.nodes.length > 0 ? options.nodes[0] : null;
|
|
12375
12700
|
return Array.isArray(rootNode?.children) && rootNode.children.length > 0;
|
|
12376
12701
|
};
|
|
12377
12702
|
const isParentOrChildrenSelected = (nodeId) => {
|
|
12703
|
+
const cached = parentOrChildrenSelectedCache.get(nodeId);
|
|
12704
|
+
if (cached !== void 0) return cached;
|
|
12378
12705
|
const node = findNodeObjectById(nodeId);
|
|
12379
12706
|
if (!node || !hasChildrenNodes(node.children || [])) return false;
|
|
12380
|
-
|
|
12707
|
+
const value = selectedNodes.has(node.nodeId) || isAnyChildSelected(node.children || []);
|
|
12708
|
+
parentOrChildrenSelectedCache.set(nodeId, value);
|
|
12709
|
+
return value;
|
|
12381
12710
|
};
|
|
12382
12711
|
const isParentAndAllChildrenSelected = (nodeId) => {
|
|
12712
|
+
const cached = parentAndAllChildrenSelectedCache.get(nodeId);
|
|
12713
|
+
if (cached !== void 0) return cached;
|
|
12383
12714
|
const node = findNodeObjectById(nodeId);
|
|
12384
12715
|
if (!node) return false;
|
|
12385
|
-
|
|
12716
|
+
const value = selectedNodes.has(node.nodeId) && isEveryChildSelected(node);
|
|
12717
|
+
parentAndAllChildrenSelectedCache.set(nodeId, value);
|
|
12718
|
+
return value;
|
|
12386
12719
|
};
|
|
12387
12720
|
const isParentOnlySelected = (nodeId) => {
|
|
12721
|
+
const cached = parentOnlySelectedCache.get(nodeId);
|
|
12722
|
+
if (cached !== void 0) return cached;
|
|
12388
12723
|
const node = findNodeObjectById(nodeId);
|
|
12389
12724
|
if (!node || !hasChildrenNodes(node.children || [])) return false;
|
|
12390
|
-
|
|
12725
|
+
const value = !isAnyChildSelected(node.children || []) && selectedNodes.has(node.nodeId);
|
|
12726
|
+
parentOnlySelectedCache.set(nodeId, value);
|
|
12727
|
+
return value;
|
|
12391
12728
|
};
|
|
12392
12729
|
const isEveryChildSelected = (node) => {
|
|
12393
12730
|
if (!node.children || node.children.length === 0) return true;
|
|
@@ -12419,9 +12756,13 @@ const useTreeState = (options = {}) => {
|
|
|
12419
12756
|
return hasSelected || hasIndeterminate;
|
|
12420
12757
|
};
|
|
12421
12758
|
const isNodeIndeterminateById = (nodeId) => {
|
|
12759
|
+
const cached = nodeIndeterminateByIdCache.get(nodeId);
|
|
12760
|
+
if (cached !== void 0) return cached;
|
|
12422
12761
|
const node = findNodeObjectById(nodeId);
|
|
12423
12762
|
if (!node) return false;
|
|
12424
|
-
|
|
12763
|
+
const value = isNodeIndeterminate(node.children || [], nodeId);
|
|
12764
|
+
nodeIndeterminateByIdCache.set(nodeId, value);
|
|
12765
|
+
return value;
|
|
12425
12766
|
};
|
|
12426
12767
|
const toggleSelectNode = (nodeId, title, data) => {
|
|
12427
12768
|
let node = findNodeObjectById(nodeId);
|
|
@@ -12432,6 +12773,8 @@ const useTreeState = (options = {}) => {
|
|
|
12432
12773
|
children: [],
|
|
12433
12774
|
data
|
|
12434
12775
|
};
|
|
12776
|
+
nodeIndex.set(nodeId, node);
|
|
12777
|
+
subtreeNodeIdsIndex.set(nodeId, [nodeId]);
|
|
12435
12778
|
}
|
|
12436
12779
|
if (!node) return;
|
|
12437
12780
|
if (selectedNodes.has(nodeId)) {
|
|
@@ -12442,6 +12785,7 @@ const useTreeState = (options = {}) => {
|
|
|
12442
12785
|
expandNode(nodeId);
|
|
12443
12786
|
}
|
|
12444
12787
|
}
|
|
12788
|
+
clearDerivedSelectionCaches();
|
|
12445
12789
|
};
|
|
12446
12790
|
const toggleExpandNode = (nodeId) => {
|
|
12447
12791
|
if (isNodeExpanded(nodeId)) {
|
|
@@ -12618,6 +12962,7 @@ const useTreeState = (options = {}) => {
|
|
|
12618
12962
|
searchTerm,
|
|
12619
12963
|
filteredMatchCount,
|
|
12620
12964
|
totalNodeCount,
|
|
12965
|
+
selectionVersion,
|
|
12621
12966
|
selectAllChildren,
|
|
12622
12967
|
selectedNodeObjects,
|
|
12623
12968
|
selectedNodes,
|
|
@@ -12721,6 +13066,16 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
12721
13066
|
if (!props.showChildrenCount || !hasChildrenNodes.value) return null;
|
|
12722
13067
|
return isSearchActive.value ? filteredNodes.value?.length ?? 0 : props.nodes.length;
|
|
12723
13068
|
});
|
|
13069
|
+
const nodeIsSelected = vue.computed(() => treeState?.isNodeSelected(props.nodeId) ?? false);
|
|
13070
|
+
const nodeIsIndeterminate = vue.computed(
|
|
13071
|
+
() => props.showIndeterminate ? treeState?.isNodeIndeterminateById(props.nodeId) ?? false : false
|
|
13072
|
+
);
|
|
13073
|
+
const shouldShowPopoverActions = vue.computed(
|
|
13074
|
+
() => (treeState?.isParentOrChildrenSelected(props.nodeId) ?? false) && !nodeIsIndeterminate.value
|
|
13075
|
+
);
|
|
13076
|
+
const toggleNodeIcon = vue.computed(
|
|
13077
|
+
() => treeState?.getNodeIcon(props.nodeId, props.nodeExpandIcon, props.nodeCollapseIcon) ?? props.nodeExpandIcon
|
|
13078
|
+
);
|
|
12724
13079
|
vue.watch(
|
|
12725
13080
|
() => ({
|
|
12726
13081
|
enabled: props.searchEnabled,
|
|
@@ -12818,15 +13173,19 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
12818
13173
|
return "";
|
|
12819
13174
|
});
|
|
12820
13175
|
const selectedOption = vue.ref(currentOption.value);
|
|
13176
|
+
const isSyncingSelectedOption = vue.ref(false);
|
|
12821
13177
|
vue.watch(
|
|
12822
13178
|
currentOption,
|
|
12823
13179
|
(newValue) => {
|
|
13180
|
+
isSyncingSelectedOption.value = true;
|
|
12824
13181
|
selectedOption.value = newValue;
|
|
13182
|
+
isSyncingSelectedOption.value = false;
|
|
12825
13183
|
},
|
|
12826
13184
|
{ immediate: true }
|
|
12827
13185
|
);
|
|
12828
13186
|
vue.watch(selectedOption, (newValue) => {
|
|
12829
|
-
if (
|
|
13187
|
+
if (isSyncingSelectedOption.value || !isOpen.value) return;
|
|
13188
|
+
if (newValue && newValue !== currentOption.value) {
|
|
12830
13189
|
handleOptionClick(newValue);
|
|
12831
13190
|
}
|
|
12832
13191
|
});
|
|
@@ -12852,7 +13211,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
12852
13211
|
key: 0,
|
|
12853
13212
|
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(treeState)?.toggleExpandNode(props.nodeId))
|
|
12854
13213
|
}, { "aria-label": props.title ? childrenToggleAriaLabel(props.title) : void 0 }, {
|
|
12855
|
-
icon:
|
|
13214
|
+
icon: toggleNodeIcon.value,
|
|
12856
13215
|
size: 24,
|
|
12857
13216
|
class: "fill-blue-500 mr-3 mt-0.5 items-center"
|
|
12858
13217
|
}), null, 16, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -12863,8 +13222,8 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
12863
13222
|
vue.createElementVNode("div", _hoisted_2$6, [
|
|
12864
13223
|
vue.createVNode(_sfc_main$j, {
|
|
12865
13224
|
id: `checkbox-${props.nodeId}`,
|
|
12866
|
-
checked:
|
|
12867
|
-
indeterminate:
|
|
13225
|
+
checked: nodeIsSelected.value,
|
|
13226
|
+
indeterminate: nodeIsIndeterminate.value,
|
|
12868
13227
|
onChange: _cache[1] || (_cache[1] = ($event) => vue.unref(treeState)?.toggleSelectNode(props.nodeId, props.title, props.data))
|
|
12869
13228
|
}, {
|
|
12870
13229
|
default: vue.withCtx(() => [
|
|
@@ -12879,7 +13238,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
12879
13238
|
_: 1
|
|
12880
13239
|
}, 8, ["id", "checked", "indeterminate"])
|
|
12881
13240
|
]),
|
|
12882
|
-
|
|
13241
|
+
shouldShowPopoverActions.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$3, [
|
|
12883
13242
|
vue.createVNode(_sfc_main$I, vue.mergeProps({
|
|
12884
13243
|
ref_key: "triggerRef",
|
|
12885
13244
|
ref: triggerRef,
|
|
@@ -12987,21 +13346,6 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
|
12987
13346
|
};
|
|
12988
13347
|
}
|
|
12989
13348
|
});
|
|
12990
|
-
function useElementFinalSize(elementRef, onFinalSize, delay = 100) {
|
|
12991
|
-
vue.watchEffect((onCleanup) => {
|
|
12992
|
-
const { value: element } = elementRef;
|
|
12993
|
-
if (!element) return;
|
|
12994
|
-
const timeoutId = setTimeout(() => {
|
|
12995
|
-
requestAnimationFrame(() => {
|
|
12996
|
-
const { height } = element.getBoundingClientRect();
|
|
12997
|
-
if (height > 0) {
|
|
12998
|
-
onFinalSize(height);
|
|
12999
|
-
}
|
|
13000
|
-
});
|
|
13001
|
-
}, delay);
|
|
13002
|
-
onCleanup(() => clearTimeout(timeoutId));
|
|
13003
|
-
});
|
|
13004
|
-
}
|
|
13005
13349
|
const _hoisted_1$8 = { key: 0 };
|
|
13006
13350
|
const _hoisted_2$5 = {
|
|
13007
13351
|
key: 0,
|
|
@@ -13059,28 +13403,35 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
|
13059
13403
|
searchInputTriggerLength: props.searchInputTriggerLength
|
|
13060
13404
|
});
|
|
13061
13405
|
vue.provide("treeState", treeState);
|
|
13062
|
-
const
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13406
|
+
const prunedNodeCache = /* @__PURE__ */ new WeakMap();
|
|
13407
|
+
const pruneNodeCached = (node) => {
|
|
13408
|
+
const cached = prunedNodeCache.get(node);
|
|
13409
|
+
if (cached) return cached;
|
|
13410
|
+
const pruned = {
|
|
13411
|
+
nodeId: node.nodeId,
|
|
13412
|
+
title: node.title,
|
|
13413
|
+
data: node.data,
|
|
13414
|
+
children: Array.isArray(node.children) ? node.children.map(pruneNodeCached) : void 0
|
|
13415
|
+
};
|
|
13416
|
+
prunedNodeCache.set(node, pruned);
|
|
13417
|
+
return pruned;
|
|
13418
|
+
};
|
|
13419
|
+
const getPrunedSelectedNodes = () => treeState.selectedNodeObjects.map(pruneNodeCached);
|
|
13069
13420
|
const searchContainerRef = vue.ref(null);
|
|
13070
13421
|
useElementFinalSize(searchContainerRef, (height) => {
|
|
13071
13422
|
emit("getSearchContainerHeight", height);
|
|
13072
13423
|
});
|
|
13073
13424
|
__expose({
|
|
13074
|
-
selectedNodeObjects,
|
|
13425
|
+
selectedNodeObjects: vue.computed(() => getPrunedSelectedNodes()),
|
|
13075
13426
|
selectedNodes: treeState.selectedNodes,
|
|
13076
13427
|
getSearchContainerHeight: () => searchContainerRef.value?.getBoundingClientRect().height
|
|
13077
13428
|
});
|
|
13078
13429
|
vue.watch(
|
|
13079
|
-
() => treeState.
|
|
13430
|
+
() => treeState.selectionVersion.value,
|
|
13080
13431
|
() => {
|
|
13081
|
-
emit("update:selectedNodes",
|
|
13432
|
+
emit("update:selectedNodes", getPrunedSelectedNodes());
|
|
13082
13433
|
},
|
|
13083
|
-
{
|
|
13434
|
+
{ flush: "post" }
|
|
13084
13435
|
);
|
|
13085
13436
|
const totalNodeCount = vue.computed(() => 1 + (treeState?.totalNodeCount.value ?? 0));
|
|
13086
13437
|
const rootAttrs = vue.computed(() => {
|
|
@@ -14927,6 +15278,16 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
14927
15278
|
const weekToRender = vue.computed(() => getDaysInWeek(currentWeek.value));
|
|
14928
15279
|
const visibleWeekDays = vue.computed(() => weekToRender.value.filter((day) => getISODay(day) <= 5));
|
|
14929
15280
|
const lastWeek = vue.computed(() => getDaysOfLastWeek(subWeeks(currentWeek.value)));
|
|
15281
|
+
const onHandleSelectedDay = (weekDay) => {
|
|
15282
|
+
selectedDay.value = weekDay;
|
|
15283
|
+
emit("select-date", weekDay);
|
|
15284
|
+
};
|
|
15285
|
+
const onHandleSetCurrentWeek = (week) => {
|
|
15286
|
+
if (selectedDay.value && !isSameWeek(selectedDay.value, week, { weekStartsOn: 1 })) {
|
|
15287
|
+
onHandleSelectedDay(null);
|
|
15288
|
+
}
|
|
15289
|
+
currentWeek.value = week;
|
|
15290
|
+
};
|
|
14930
15291
|
const weekText = vue.computed(
|
|
14931
15292
|
() => `${getOverlappingMonths(currentWeek.value, locale.value)} (${t("FdsWeekCalendar.week")} ${getISOWeek(currentWeek.value)})`
|
|
14932
15293
|
);
|
|
@@ -15000,16 +15361,6 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
15000
15361
|
},
|
|
15001
15362
|
{ immediate: true }
|
|
15002
15363
|
);
|
|
15003
|
-
const onHandleSelectedDay = (weekDay) => {
|
|
15004
|
-
selectedDay.value = weekDay;
|
|
15005
|
-
emit("select-date", weekDay);
|
|
15006
|
-
};
|
|
15007
|
-
const onHandleSetCurrentWeek = (week) => {
|
|
15008
|
-
if (selectedDay.value && !isSameWeek(selectedDay.value, week, { weekStartsOn: 1 })) {
|
|
15009
|
-
onHandleSelectedDay(null);
|
|
15010
|
-
}
|
|
15011
|
-
currentWeek.value = week;
|
|
15012
|
-
};
|
|
15013
15364
|
const navigateToWeek = (week) => {
|
|
15014
15365
|
const normalizedWeek = startOfISOWeek(week);
|
|
15015
15366
|
if (isSameWeek(normalizedWeek, currentWeek.value, { weekStartsOn: 1 })) return;
|